Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ListView Questions


Message #1 by "Terry Holland" <londontel@h...> on Fri, 23 Mar 2001 16:50:27
I can at least help with the Right-Clicking.  Assuming you know how to
create a PopUp Menu in VB.

On the "MouseDown" event you can Validate which item the User has
Right-Clicked on by seeing if the "Button" variable = vbRightButton.  You
had better store unique keys within each Item (during the population of the
List View items), for example if you have a User's List:

lvUsers.ListItems.Add , "User:" & rstUsers!UserID, rstUsers!Username

Then to find which Item was clicked, grab the ID from the Item:

ID = Mid$(lvUsers.SelectedItem.Key, Instr(1, lvUsers.SelectedItem.Key, ":")
+ 1)

Try changing the Selected Item color to vbWhite, hehe!

-----Original Message-----
From: Terry Holland [mailto:londontel@h...]
Sent: Friday, March 23, 2001 11:50 AM
To: professional vb
Subject: [pro_vb] ListView Questions


I have two listview questions.

1) Is there a way to have the selection hidden at all times, and not only 
when the control loses focus? At the moment, if a user clicks an item, 
that item becomes high-lighted.  If a user clicks the control the selected 
item becomes high-lighted.  The only thing I want to see if user clicks a 
label is the status of the checkbox changing. Maybe I can change the 
Selected colour to something a little less prominent??

2) how would I show a popup menu when user right-clicks an item in the 
list?

Thanks in advance for any help

-Telb')

  Return to Index