Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Listbox
Message
De
10/03/1999 09:50:45
 
 
À
10/03/1999 09:40:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00195811
Message ID:
00195819
Vues:
29
>Greetings,
>
>I am trying to design a class that contains a text box and a list box. (Similar to the help in windows). I want to be able to type in text in the text box and as the user enters data, I want the list box to select the row that matches.
>
>The code below works great as long as the index order matches the record number. When I index a table and set the order, the record number always stays with the record. How do I refer to the correct item in the list when the record number and listindex do not match?
>
>Thanks in advance,
>
>Scott
>
>I am using VFP 3.0b.
>
>
>***Text 1 interactivechange event
>set exact off
>seek alltrim(upper(this.value))
>
>if found()
> nRec = recno()
> this.parent.list1.selected(nRec) = .t.
>endif
>
>this.refresh

Try to set Listbox.Value and then Setfocus:
*** textbox.interactivechange event
SELECT mycursor  && this is listbox rowsource
SEEK ...
IF FOUND()
 With Thisform.MyListbox
   .Value=mycursor.myfield   && it must be character, use ALLTRIM(STR()) if you have integer field
   .Setfocus
 Endwith
ENDIF
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform