[Gambas-user] ComboBox_Click Problem

tobias tobiasboe1 at ...20...
Sat Jul 9 12:39:29 CEST 2011


hi,

i encountered a problem - for me - in gambas3 regarding ComboBox_Click() 
event. i have a directory name in ComboBox.Text and the contents of this 
directory in ComboBox.List. i implemented _Click() to append the current 
item's text to the directory path:

Public Sub ComboBox1_Click()

   Dim sPath As String

   Print ComboBox1.Text
   sPath = Mid$(ComboBox1.Text, 1, RInStr(ComboBox1.Text, "/"))
   ComboBox1.Text = sPath &/ ComboBox1.Current.Text

End

this results in e.g. "bin" (if ComboBox1.Text was "/" before) as output 
in terminal, so the ComboBox.Text is changed to the text of the selected 
item before the event is raised. i tried Stop Event but this didn't 
help. i want to preserve the previous text. the text of the current 
selected item is in ComboBox1.Current.Text, too, so it's twice available 
but i don't see a proper way to get the previous text.
or is this expected? i don't know if this is the same in gb2...

regards,
tobi




More information about the User mailing list