Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

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.
0
sk33v3
Asked:
sk33v3
1 Solution
 
xSinbadCommented:
Like this;

ListView1.ListItems(5).EnsureVisible
ListView1.ListItems(5).Selected = True
ListView1.SetFocus
0
 
sk33v3Author Commented:
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.
0
 
sk33v3Author Commented:
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
xSinbadCommented:
Yes what ever the list item index number is.
0
 
ophirgCommented:
Hi.

Set the FullRowSelect property to true.

ListView.FullRowSelect = True

Ophir.
0
 
marconovaroCommented:

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.
0
 
sk33v3Author Commented:
Sinbad yours didn't work. but ophirg you answered my problem first. Thanks ophirg and macronovaro.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now