[Gambas-user] Automatic selection in a listbox
Benoit Minisini
gambas at ...1...
Fri Dec 2 00:03:21 CET 2005
On Thursday 01 December 2005 18:55, Felice Cafarelli wrote:
> Subject: Automatic selection in a listbox
> Date: 17:53, giovedì 1 dicembre 2005
> From: Felice Cafarelli <felixcafarelli at ...1176...>
> To: gambas-user at lists.sourceforge.net
>
> Hi all, I had a problem with a listbox in gambas1.0.13:
> I populate dinamically (values from db) a listbox, and I want to
> automatically select the first value in the list after the population. I
> tried with the property INDEX, but I got only '-1' indexes, so i cannot
> distinguish the first item in the list. What can i do?
> I post here the code:
>
> FOR i = 1 TO rNumber
> lstUsers.Add(rData!user & "(" & lstUsers.Index & ")")
> IF lstUsers.Index = 0 THEN
> lstUsers.SetFocus
> lstUsers.Current.Selected
> ENDIF
> rData.MoveNext
> NEXT
>
> Result is this list
>
> Bob(-1)
> Simon(-1)
> Teddy(-1)
>
> So I want Bob to be automatically selected... any idea?
> Cheers
> Felix
>
>
Do you have the same repeat symptom as John Hedge ? :-)
--
Benoit Minisini
More information about the User
mailing list