Bill
Bill

Reputation: 345

Highlight the first row in a ListView and a ListBox Control

I am attempting to show both a ListView and ListBox on a Windows Form (C#). The difficulty I am having is in having the first row for both the ListView and ListBox highlighted when the application opens. Could someone please steer me in the right direction so that the first row of both the ListView and ListBox are highlighted when the application opens?

Upvotes: 2

Views: 1592

Answers (1)

Stroomtang
Stroomtang

Reputation: 300

For ListBox:

listBox1.SelectedIndex = 0;

Add this line after you have filled your ListBox with items.

Upvotes: 1

Related Questions