Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you select items in a listbox by value?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00453572
Message ID:
00453811
Vues:
19
>>>Is it possible to programmatically select item(s) in a listbox by the value(s) instead of using the Index or ItemID?
* This code sets listbox points using the list value

public of
oF=createobject('MyForm')
of.show
of.AddObject('LLB','LeftListBox')
of.AddObject('RLB','RightListBox')
for c=1 to 12 && Populate List Box With Months
lcMonth=left(upper(cmonth(date(2000,c,1)))+space(20),20)
of.LLB.Additem(lcMonth)
of.RLB.AddItem(lcMonth)
endfor
store 0 to of.LLB.ListIndex,of.RLB.ListIndex
store .t. to of.LLB.Visible,of.RLB.Visible

defin class MyForm as Form
Autocenter=.t.
enddef

define class LeftListBox as ListBox
left=5
width=150
procedure InterActiveChange
LBIAChange('of.LLB','of.RLB')
endproc
enddef

define class RightListBox as ListBox
left =200
width=150
procedure InterActiveChange
LBIAChange('of.RLB','of.LLB')
endproc
enddef

procedure LBIAChange(ReadValue,SetValue)
&SetValue..Value=&ReadValue..Value
endproc
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform