Code: Select all
Gui,Add,DDL,vColorChoice,Red|Green|Blue|Black|White
;Gui,Add,ComboBox,vColorChoice,Red|Green|Blue|Black|White ; also happens with this
Gui,Add,Button,,OK
Gui,Show
Return
ButtonOK:
Gui,Submit,NoHide
GuiControl,,ColorChoice,| ; empty control
MsgBox look at drop-down now
Return
GuiClose:
ExitApp
"To make the control empty, specify only a pipe character (|)."
Yes, it sets all the choices to null, but it remembers the height of the list from the last time it was populated.
For example, if the Gui,Add,DDL or Gui,Add,ComboBox statement has no values specified, the drop-down list looks like this — truly empty:
That's what I would expect to see after clearing the control with the pipe-only string. But the result from running the script above is this:
Even though the list has "empty" choices, it remembers the height from the previous population of the five colors. Is this a bug or feature? In either case, is there a work-around to have it display the drop-down list as shown in the first screenshot in this post (without having to destroy the GUI)? Thanks, Joe