ListView Select a line

  • Thread starter Thread starter Roger Renaud
  • Start date Start date
R

Roger Renaud

I don't know how to select a line in a LISTVIEW control. In VB6 it looked
like

lv.ListItems(i).Checked = True, if I remember, but I don't find the write
way in VB.NET.

RR Thanks
 
To select the i-th item, you can use code such as

ctlListView.Items(i).Selected = True

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
************************************
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
 
Roger Renaud said:
I don't know how to select a line in a LISTVIEW control.

checked = true checks an item, it doesn't select it.
In VB6 it
looked like

lv.ListItems(i).Checked = True, if I remember, but I don't find the
write way in VB.NET.


lv.ListItems.Items(i).Checked = True
 
* "Roger Renaud said:
I don't know how to select a line in a LISTVIEW control. In VB6 it looked
like

lv.ListItems(i).Checked = True, if I remember, but I don't find the write
way in VB.NET.

Do you want to check the checkbox of the line or do you want to select
it?

Use 'lv.Items(i).Selected = True' to select the item, set its 'Checked'
property to 'True' in order to check its checkbox.
 
Back
Top