By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,327 Members | 1,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,327 IT Pros & Developers. It's quick & easy.

context menu on listview

P: n/a
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!
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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:OR**************@TK2MSFTNGP11.phx.gbl...
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!

Nov 20 '05 #2

P: n/a
* 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/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.