[Gambas-user] ComboBox_Click Problem

tobias tobiasboe1 at ...20...
Mon Jul 11 21:54:25 CEST 2011

On 11.07.2011 21:37, Matti wrote:
> Hi Tobias,
> for me, it looks like ComboBox.Text is made only to show something like "Please
> select something" or "All entries". As soon as you select an item, ComboBox.Text
> is replaced by that item. I tried the Click and the Change event, and in both
> cases it's gone. Benoit might correct me here.
> But this should be no problem: when you set ComboBox.Text, why don't you store
> your path in a variable and put it together afterwards with the selected item?
> Matti
> Am 09.07.2011 12:39, schrieb tobias:
>> 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
of course, but i consider this as a workaround...

More information about the User mailing list