Page 1 of 1

add option to dropdownlist

Posted: 19 May 2022, 12:54
by jon3cz3k_
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?

Re: add option to dropdownlist

Posted: 19 May 2022, 13:23
by mikeyww

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