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

Highlighting first item in list box

Status
Not open for further replies.

amills

Programmer
May 30, 2003
22
US
How can I get the first item in the list box to be highlighted when the Page Frame is activated ?
I've tried
Thisform.Pageframe.page1.list1.refresh
Thisform.Pageframe.page1.list1.setfocus

The list box is populated with notes by date and I want to have the most recent item highlighted so the user can use the arrow keys to scroll up and down without having to click on the list box first.


Andy
 

Thisform.Pageframe.page1.list1.SelectedID(1) = .t.

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
There are actually several ways to do this. In addition to Ali's suggestion, you can set the ListBox's ListItem property to 1. If the ListBox has a ControlSource, it will automatically be on the item that corresponds to the value in that ControlSource. So, for example, if you using a form property as a ControlSource, you can set the property to be whatever is the first item in the list.



-BP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top