Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you select items in a listbox by value?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00453572
Message ID:
00453811
Views:
18
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform