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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically selecting a row in a listbox on open of a form

Status
Not open for further replies.
Aug 9, 2001
23
0
0
GB
Simple or not I am having a problem with listboxes.

All I want to do is have the first (or indeed any) row highlighted when the form containing the listbox is opened.

Can anyone help?

Thanks,

Thom
 
try using this in the Form's On Load Event

ListBoxName = ListBoxName.ItemData(0)

PaulF
 
That doesn't seem to work. The only way I can get it to work at the moment is by using the send keys function. ie:

listbox.SetFocus
SendKeys "{DOWN}"

Which is a bit messy, but its all I've got at the moment!

Thanks for your input,

Thom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top