473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Listview and ContextMenuStrip - doesn't work...

Hi,

I'm attaching a ContextMenuStrip to a listview. Debugging shows the menu is
healthy with one item in it and that it's referred to by the
"listview.ContextMenuStrip". However, right clicking the list view or
elements doesn't bring up the menu. Any ideas?

Thanks,
Ron

Nov 7 '06 #1
3 4493
I am using it without problems. Do you have any event handlers that are
interfering maybe?

--
Regards, Peter
Nov 7 '06 #2
Seems like I have to process the mouse click item, figure out which list
view element is selected and ".Show(...)" the context menu strip on the X,Y
location of the click.

for some reason I thought it's done automatically for listviews as it's done
for tree nodes. seems like I was mistaken.

thanks.
Ron

"Peter Thornqvist" <pe*************@gmail.comwrote in message
news:ui**************@TK2MSFTNGP02.phx.gbl...
>I am using it without problems. Do you have any event handlers that are
interfering maybe?

--
Regards, Peter

Nov 7 '06 #3
Seems like I have to process the mouse click item, figure out which list
view element is selected and ".Show(...)" the context menu strip on the
X,Y location of the click.

for some reason I thought it's done automatically for listviews as it's
done for tree nodes. seems like I was mistaken.
You shouldn't have to call Show on the popup menu. It should display
automatically unless you have a MouseDown handler on the listview or an
Opening handler on the popup that prevents it from showing.

If you need to determine the currently selected listview item before the
menu is shown, you can use the Opening handler of the popup. You still
shouldn't have to explicitly call Show though.

--
Regards, Peter
Nov 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: news.microsoft.com | last post by:
Hello, I have attached a contextmenustrip in the designer to a listview. When running, if there is no item in my listview, the contextmenu still shows. How can I hide it when no item is...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
5
by: =?Utf-8?B?cHJvZ2dlcg==?= | last post by:
I've written an application that can minimize to the tray and can reappear if you double click on the icon in the tray (ShowInTaskbar is set to false). I've also created a ContextMenuStrip (Visual...
0
by: Bllich | last post by:
I have contextMenuStrip that needs to be shown when my listview item is right-cliked.. I've set the contextMenuStrip property of listview to a contextMenuStrip that I created and when I run the...
0
by: Tark Siala | last post by:
Hi I have ListView include customers (foe example), and connected to "ContextMenuStrip" include (Edit Customer, Delete Customer, ...), when user right click on any Customer Item in ListView...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
9
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
Hi, I have a form (Form1) with a ContextMenuStrip (ContextMenuStrip1). If I pass Form1 to a Utility Sub with the following code: Public Sub Utility(theForm as Object) with theForm For Each...
1
by: Adam Clauss | last post by:
I have a ListView (in 'details' view) to which I added a ContextMenuStrip (using the designer). This is all good, except that the context menu also appears when I right click a column header - I...
2
by: eBob.com | last post by:
I've been working on an app which has an array of RichTextBoxes. And I have a context menu for the RTBs. The context menu has two levels; the first level has two items, "Load Sample Text File"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.