Preselect item in listbox to allow keyboard ENTER to select

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to preselect the first row in my listbox so a user can just hit the enter key rather than use the mouse to select it. I tried setting the .selected property but that just froze my listbox. is this possible?
 
Is your listbox's MultiSelect property set to something other than None?
If it's None, the .Selected property can't be used reliably.
You can set the listbox's ListIndex to 0, though, to select the first row -
or 1 if you're displaying headers.

HTH
- Turtle

David said:
I'd like to preselect the first row in my listbox so a user can just hit
the enter key rather than use the mouse to select it. I tried setting the
..selected property but that just froze my listbox. is this possible?
 
Your statement is not entirely accurate. You can write to the ListIndex
prop as long as the control has the focus.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top