Solved

VB 2005 ListView - Selected row disappears when clicking on other controls

Posted on 2007-11-25
4
287 Views
Last Modified: 2013-12-25
Hi

I have a ListView control on a windows form. When I click on another control, the selected row (or greay shading on this) dissapears.

I want it to stay there. How do I do this?
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 10

Expert Comment

by:effx
ID: 20345793
ListView.SetFocus
0
 

Author Comment

by:murbro
ID: 20348960
Hi

I want the selected line in the ListView to show as selected even when the ListView no longer has the focus
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 20351388
You have to change the property HideSelection to False

Listview1.HideSelection = False

jpaulino
0
 

Author Closing Comment

by:murbro
ID: 31410849
Thanks very much
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
using Access 8 75
Excel - Save a copy of work book 13 88
Sorting multiple rows and columns, and count duplicates in Excel 2013 4 87
How to Add / Edit Windows Menu 4 67
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

809 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