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

Which item did I right-click in a multiselect listview

P: n/a
I have a multiselect listview with an associated context menu. If the user
selects several items in the list and then right-clicks one of them is it
possible to tell in the handler which item was right-clicked?
--
Dave
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
try this in MouseUp or MouseDown events

if( e.Button == MouseButtons.Right )
{
listView1.GetItemAt( e.X, e.Y ).Text )
}

"Dave" wrote:
I have a multiselect listview with an associated context menu. If the user
selects several items in the list and then right-clicks one of them is it
possible to tell in the handler which item was right-clicked?
--
Dave

Nov 17 '05 #2

P: n/a
Thanks avnrao. Not very elegant, but it seems to work.
--
Dave
"avnrao" wrote:
try this in MouseUp or MouseDown events

if( e.Button == MouseButtons.Right )
{
listView1.GetItemAt( e.X, e.Y ).Text )
}

"Dave" wrote:
I have a multiselect listview with an associated context menu. If the user
selects several items in the list and then right-clicks one of them is it
possible to tell in the handler which item was right-clicked?
--
Dave

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.