[Gambas-user] ComboBox usage

John Rose john.aaron.rose at mailbox.org
Thu Aug 13 20:58:54 CEST 2020


I'm a baffled by how to monitor a ComboBox's usage. I have the Text 
property of ComboBoxConnectChannel equal to 'Please Select Channel' with 
its List property empty. I then fill the list as follows:
   With ComboBoxConnectChannel
       .Clear
       .Add("BBC One")
       .Add("BBC Two")
       .Add("BBC Four")
       .Add("CBBC")
       .Add("CBeebies")
       .Add("BBC News")
       .Add("BBC Parliament")
     End With

I then want the user to select an item from the list (which is displayed 
with the correct list of values as a popup) after the user clicks on the 
arrow to the right of the textbox part of the ComboBox) and have the 
textbox (part of the ComboBox) set equal to the value of the selected 
item. At runtime, the user selects one of the items from the popup but 
its value is *not *shown in the text box part of the ComboBox:
   Public Sub ComboBoxConnectChannel_Change()
     sConnectChannel = Trim(ComboBoxConnectChannel.Text)
     Print "Channel=" & sConnectChannel
   End

So for example if the user has clicked on the arrow followed by clicking 
on the 'BBC Four' item, the variable sConnectChannel is set equal to 
'BBC Four' correctly but the textbox part of the ComboBox still shows 
'Please Select Channel'. What do I change in the above Public Sub coding 
to achieve this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200813/fd841fa0/attachment.html>


More information about the User mailing list