|
-
Aug 9th, 2005, 10:57 PM
#1
Thread Starter
Admodistrator
[RESOLVED] Change listview.selecteditem thru code?
I have a popupmenu on my listview, and that only fires when a person right clicks. I want it so that if the user right clicks it will still highlight the line they clicked on...possible?
-
Aug 10th, 2005, 12:41 AM
#2
New Member
Re: Change listview.selecteditem thru code?
this is 100% out of this thread, but do you know what </vac> is? or msx?
...name looks farmiliar.
-
Aug 10th, 2005, 11:26 AM
#3
Thread Starter
Admodistrator
Re: Change listview.selecteditem thru code?
no clue what <vac> is...does anyone have a reasonable answer?
-
Aug 10th, 2005, 12:03 PM
#4
Fanatic Member
Re: Change listview.selecteditem thru code?
In the click event you should be able to add lstViewName.ListItems(Index).Selected = True
-
Aug 10th, 2005, 12:27 PM
#5
Thread Starter
Admodistrator
Re: Change listview.selecteditem thru code?
Thanks, that works perfect
-
Aug 10th, 2005, 12:27 PM
#6
Re: Change listview.selecteditem thru code?
Only it isn't a click event.... use the Mouse up event and check for the right-click.
Part of the parameters to the event is the X & Y co-ord of the event. PAss those to the .HitTest method, which will pass back the item located under the cursor at the time of the mouseup. If it's nothing then the user didn't click over a usable listview item. If something does come back, use that object's (which should be a ListItem) .Selected property to select it.
I think that's right.... it's been a while since I've done it... but that does sound right - I might have the data type wrong on the .HitTest return.
Tg
-ps viper-- was that *really* necessary?
-
Aug 10th, 2005, 12:36 PM
#7
Re: Change listview.selecteditem thru code?
What worked? His or mine? I'd like to know so that if I'm off base I don't do that again....
Tg
-
Aug 10th, 2005, 12:41 PM
#8
Thread Starter
Admodistrator
Re: [RESOLVED] Change listview.selecteditem thru code?
Both, i knew i had to put it in the mousedown event but with his code and such it worked
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|