Link to home
Start Free TrialLog in
Avatar of sk33v3
sk33v3

asked on

ListView Highlighting

What i am wanting to do is let the user click on one of the items in the listview and have the entire line highlight. currently i have the listview set up on report view. Thanks for any help.
Avatar of xSinbad
xSinbad

Like this;

ListView1.ListItems(5).EnsureVisible
ListView1.ListItems(5).Selected = True
ListView1.SetFocus
Avatar of sk33v3

ASKER

what is the 5 used for? What i am trying to figure out from that code is does 5 have to be 5 or can it be 46 or some other number.
Avatar of sk33v3

ASKER

what is the 5 used for? What i am trying to figure out from that code is does 5 have to be 5 or can it be 46 or some other number.
Yes what ever the list item index number is.
ASKER CERTIFIED SOLUTION
Avatar of ophirg
ophirg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

If you are using the Microsoft Windows Common Controls version 6.0, you can set the FullRowSelect property either at design or at run time. At design time, you can use the property window that you can find right clicking the listview.

If you have an older version of the Common Controls, you can have a look to the following MSKB article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q181440

where you can find how to do it programmatically.
Hope this helps you.
Marco.
Avatar of sk33v3

ASKER

Sinbad yours didn't work. but ophirg you answered my problem first. Thanks ophirg and macronovaro.