• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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