PC Review


Reply
Thread Tools Rate Thread

context menu on listview

 
 
Darin
Guest
Posts: n/a
 
      14th Jul 2004
I have 2 listview's that have the same context menu tied to them. WHen
the user opens the context menu and clicks on one of the menu items, how
(within the handles mSelPrice_click) method can I tell which listview
they are on.

THanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
The Grim Reaper
Guest
Posts: n/a
 
      14th Jul 2004
Assuming your click event sub is defined properly, as below, this should
work;

Private Sub mSelPrice_Click(ByVal sender As System.Object, e As
System.EventArgs) Handles mSelPrice_Click
Dim vClickedOnListview As String
vClickedOnListview = DirectCast(sender, Listview).Name
Messagebox.Show(vClickedOnListview)
End Sub

Obviously, you can use any property of the listview once you cast it, not
just the name.
____________________________
The Grim Reaper
"Darin" <darin_nospam@nospamever> wrote in message
news:(E-Mail Removed)...
> I have 2 listview's that have the same context menu tied to them. WHen
> the user opens the context menu and clicks on one of the menu items, how
> (within the handles mSelPrice_click) method can I tell which listview
> they are on.
>
> THanks.
>
> Darin
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      15th Jul 2004
* Darin <darin_nospam@nospamever> scripsit:
> I have 2 listview's that have the same context menu tied to them. WHen
> the user opens the context menu and clicks on one of the menu items, how
> (within the handles mSelPrice_click) method can I tell which listview
> they are on.


Check the context menu's 'SourceControl' property.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Windows Forms - ListView context menu Tom P. Microsoft C# .NET 0 24th Jul 2008 07:54 PM
Location of Context Menu in Listview O.B. Microsoft C# .NET 5 30th Mar 2008 08:07 AM
Context Menu on ListView =?Utf-8?B?QnJpYW4gS2VhdGluZw==?= Microsoft C# .NET 2 18th Apr 2005 05:46 PM
Listview with Context Menu Blacksmith Microsoft Dot NET Compact Framework 2 3rd Mar 2005 12:10 PM
Explorer Context menu in my ListView (newbie) Marcel Hug Microsoft C# .NET 1 13th Jan 2005 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:27 PM.