[Gambas-user] ComboBox usage

Bruce adamnt42 at gmail.com
Fri Aug 14 08:55:17 CEST 2020



On 14/8/20 4:05 pm, John Rose wrote:
> When I run the attached stripped-down TestApp3 app, the app enters 
> ComboBoxConnectChannel_Change before I select an item (possibly due to 
> clicking on the combobox's arrow 

As soon as you activate the combobox (by any means) it will try to 
locate the string in its' textbox within its' list. This will 
automatically raise a Change event (because the Index has changed). So 
what you describe is perfectly correct.

Also, I believe without checking, that the string in the textbox part is 
not changed  until after the runtime has processed all its' list of 
events that are stacked at that point. So if you interject a handler in 
that stack (as you have) the text will not have been set. As I said, 
that is a belief without checking, just from memory of something similar.

Finally,
 > sConnectChannel = Trim(ComboBoxConnectChannel.Text)
will return the string ine textbox, not the item in the combobox list 
that the user has selected. That data is available at 
ComboboxConnectChannel.Current.Text.
So if I'm right in my second point then that is why you are still seeing 
the original string.

bruce


More information about the User mailing list