Selecting an item in a Listview programmatically

J

Jin Kim

Hi all,

I'm trying to select an item in a listview using C#
and .NET Compact Framework. Is there anyway to do this
by passing in the index of the item I want selected?
I've tried

listView.Items(index).selected = true;

the compiler returns

(268): 'System.Windows.Forms.ListView.Items' denotes
a 'property' where a 'method' was expected

Thanks,
Jin
 
C

Chris Tacke, eMVP

The semicolon incidates C#, so shouldn't it be:

listView.Items[index].Selected = true;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top