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

Selecting an item in a listview

Status
Not open for further replies.

ZtianOS

Programmer
Aug 30, 2004
3
NO
How do I set whitch item in a listview to be selected?

In my applicaton there is a listview and a textbox. When I select an item in the listview and write a text in the textbox and press enter I want the next item in the listview to be selected. How do I set the next item to be selected?
 
Use the SelectedIndex property of the ListBox control e.g.

ListBox1.SelectedIndex = 1;

-John
 
That would work for the ListBox class, but not so easy with the ListView class...
 
I found out myself. What i was looking for was this: myListView.Items[2].Selected = true;

But tnx anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top