add option to dropdownlist

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jon3cz3k_
Posts: 18
Joined: 13 Apr 2022, 10:54

add option to dropdownlist

Post by jon3cz3k_ » 19 May 2022, 12:54

Hi! Is there a way to make an dropdownlist, edit and button wich will work like
edit box = u put "name" here
button = add option to a dropdownlist (the "name" from the edit)

hope yall understand
any way?

User avatar
mikeyww
Posts: 26599
Joined: 09 Sep 2014, 18:38

Re: add option to dropdownlist

Post by mikeyww » 19 May 2022, 13:23

Code: Select all

Gui, Font, s10
Gui, Add, ComboBox, w290 vsel gTimer , % colors := "|Red|Green|Blue|Black|White"
Gui, Add, Button  , wp               , Add
Gui, Add, Button  , wp        Default, OK
Gosub, Check
Gosub, F3
F3::Gui, Show,, Color (F3 = Show again)

Timer:
SetTimer, Check, -200
Return

ButtonAdd:
GuiControl,, sel, % colors .= "|" sel
GuiControl, ChooseString, sel, %sel%
SoundBeep, 1500
Check:
Gui, Submit, NoHide
GuiControl, % Instr(colors "|", "|" sel "|") || sel = "" ? "Disable" : "Enable", Add
GuiControl, % sel = "" ? "Disable" : "Enable", OK
Return

ButtonOK:
Gui, Submit
MsgBox, 64, Done, You chose %sel%`n`nF3 = Show again
Return

Post Reply

Return to “Ask for Help (v1)”