Solved

ListView Highlighting

Posted on 2002-06-25
7
259 Views
Last Modified: 2010-05-02
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
Comment
Question by:sk33v3
7 Comments
 
LVL 6

Expert Comment

by:xSinbad
Comment Utility
Like this;

ListView1.ListItems(5).EnsureVisible
ListView1.ListItems(5).Selected = True
ListView1.SetFocus
0
 
LVL 9

Author Comment

by:sk33v3
Comment Utility
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
 
LVL 9

Author Comment

by:sk33v3
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:xSinbad
Comment Utility
Yes what ever the list item index number is.
0
 
LVL 1

Accepted Solution

by:
ophirg earned 50 total points
Comment Utility
Hi.

Set the FullRowSelect property to true.

ListView.FullRowSelect = True

Ophir.
0
 
LVL 6

Expert Comment

by:marconovaro
Comment Utility

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
 
LVL 9

Author Comment

by:sk33v3
Comment Utility
Sinbad yours didn't work. but ophirg you answered my problem first. Thanks ophirg and macronovaro.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now