But the default item (marked by ||) seems to be exactly the same as "being able to display a given element". For example, the item displayed by a DropDownList is the currently selected item.
I am not agree with that, Chris. I explain (better I hope) :
If I have (for example) "Item1||Item2|Item3|Item4|Item5" as the the fixed list of choice of a DropDownList, ComboBox or ListBox control, Item1 will be the item displayed by default.
I think it is not a rather flexible méthod.
In fact, if I want, before displaying the GUI, to have an item other than Item1 selected by default, must I prepare, depending of the value of a variable (named var for example), someting like that :
if var = 1
gui, add, ListBox,, Item1||Item2|Item3|Item4|Item5
elseif var = 2
gui, add, ListBox,, Item1|Item2||Item3|Item4|Item5
elseif var = 3
gui, add, ListBox,, Item1|Item2|Item3||Item4|Item5
elseif var = 4
gui, add, ListBox,, Item1|Item2|Item3|Item4||Item5
elseif var = 5
gui, add, ListBox,, Item1|Item2|Item3|Item4|Item5||
I think it is not very practical
Would it not be simpler to do someting like that :
gui, add, ListBox, sItem3, Item1|Item2|Item3|Item4|Item5
(sItem3 = select the element of the list named Item3)
gui, add, ListBox, s3, Item1|Item2|Item3|Item4|Item5
(s3 = select the 3rd item of the list)
to display by default the 3rd item of the list ?
With this method, you can change before any displaying of the GUI the selected element of the list. This method seems to me more flexible. If I want the 4th element of the list to be selected by defaut :
gui, add, ListBox, sItem4, Item1|Item2|Item3|Item4|Item5
Are you OK with me ?