Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

programmatically select item in list box

Status
Not open for further replies.

pigsie

Programmer
Joined
Dec 19, 2000
Messages
307
Location
GB
Hi

Is there any way to programmatically select items in a list box?

Thanks
 
In a single select box, you can assign the value of the bound column (I think perhaps also you can use the selected property, but haven't tested):

[tt]me!lstMyList=15
me!lstMyList.selected(5) = true ' not sure[/tt]

or set the listindex, which requires the control to have focus, which again will trigger after update (and click, too?) I think.

[tt]me!lstMyList.setfocus
me!lstMyList.listindex=10 [/tt]

For multisielects,

[tt]me!lstMyList.selected(5) = true
me!lstMyList.selected(8) = true
...[/tt]

Roy-Vidar
 
I've just got round to do this thanks works perfectly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top