listbox.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Take a temp variable, called 'temp' let it equals to 'abc'. Then construct a listbox that has three entries: 1.'abc', 2.'def' and 3.'ghi'. Also add in a button, we can call it btnOk. When you click btnOk, it should select the item in the listbox that is equals to the value of 'temp'.

Right, specifying the value of temp and filling the listbox with the 3 entries is no problem. The problem is with what to do when the btnOK is pushed...

Any suggestions...

Mike55
 
Can't you just use the OnClick event to regenerate the listbox where the ListItem with the text property equal to temp has it's Selected property set to true?
 
tate said:
Can't you just use the OnClick event to regenerate the listbox where the ListItem with the text property equal to temp has it's Selected property set to true?

Got it fixed, Was using listbox.selectedItem, but that was not working - instead now using listbox.items.findbytext(temp).selected = true

Mike55
 
Back
Top