Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
List Box Question
Message
 
 
À
04/03/1998 11:45:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00082189
Message ID:
00082620
Vues:
39
Don, I think you are doing it the hard way. Don't worry about list items. Just use the listbox as your window into the table.

Set RowSource to the name of the fields in your table you want displayed. Remember to preface the first one (only) with the name of the alias:
mytable->name,ssn,hn
Set RowsourceType to fields. Set columncount to the # of fields in this list, and columnwidths as you like. Set incremental search to false. Don't worry about anything else.

Now, to do a lookup on a given tag (shown for example, not optimized):
Select myTable
Set order to (cTagWanted)
nOldRecno()=Recno()
nOldListIndex=oMyListbox.Listindex
Seek cValueToFind
Set Order to Name   && Reset to default
If !EOF()
  With oMyListBox
    * Next line is very important to move ListIndex to where you want it
     .Value=myTable.Name   && Assuming boundcolumn is Name is 1
     .Refesh()
  EndWith
Else
  Goto nOldRecno
  oMyListbox.Listindex=nOldListIndex
  MessageBox("No Hits")
Endif
Note: You can also use RowSourceType=Popup, RowSource=ThePopupName, and use DEFINE POPUP ThePopupName SCROLL Font "Courier New",9 PROMPT FIELD [any legal character string expression containing the fields / data you want displayed in the rows of the listbox]. You can only show one physical column but its contents are determined by you. You can use things like chr(149) or chr(166) to create your own column lines (with font Courier New).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform