473,766 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding right-click popup menu to windows form

VM
How can I display my own popup menu when a user right-clicks inside the
form? I know you use context menus but I don't how to implement them.

Thanks.
Nov 16 '05 #1
3 35272
Hi VM,

"VM" <vo******@yahoo .com> wrote in message
news:uD******** ******@TK2MSFTN GP12.phx.gbl...
How can I display my own popup menu when a user right-clicks inside the
form? I know you use context menus but I don't how to implement them.

Thanks.


Drop a ContextMenu component onto the form designer from the toolbox.
Create an event handler for the MouseDown event of the form. Put code in the
MouseDown event handler that looks like this (this code assumes the
ContextMenu component is named mnuContext):

if (e.Button == MouseButtons.Ri ght)
mnuContext.Show (this, new Point(e.X, e.Y));
Regards,
Daniel
Nov 16 '05 #2
drag a context menu control onto the form and fill in what you want. Then
go to the control in question and there will now be a ContextMenu property,
click on it and add your menu.
"VM" <vo******@yahoo .com> wrote in message
news:uD******** ******@TK2MSFTN GP12.phx.gbl...
How can I display my own popup menu when a user right-clicks inside the
form? I know you use context menus but I don't how to implement them.

Thanks.

Nov 16 '05 #3
VM
Thanks for the reply. It looks great.
"VM" <vo******@yahoo .com> wrote in message
news:uD******** ******@TK2MSFTN GP12.phx.gbl...
How can I display my own popup menu when a user right-clicks inside the
form? I know you use context menus but I don't how to implement them.

Thanks.

Nov 16 '05 #4

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

Similar topics

2
2178
by: lawrence | last post by:
Right now, over at www.monkeyclaus.org, the following script is getting to the 9th run through and dying after the line: echo "..."; You'll admit that is a strange place to die. I've hit refresh several times and it keeps happening. When I view page source, the last thing that shows up is the "...". The date doesn't print, nor does the closing the div tag.
2
5719
by: Dr. Richard E. Hawkins | last post by:
I've googled around, and asked everyone I know, but I still can't find any reference to anyone else having faced this particular IE bug with floats. I've put a page at http://dochawk.org/sample.html . This was made by stripping out the google ads from the regular pages. It validates as strict 4.01 at http://validator.w3.org. (The google ads drive it nuts!) The main (right) column is made with alternating left and right floats to...
10
2690
by: sp0 | last post by:
Is there a reason why to make mix numbers improper when adding? It seems when subtracting and adding, adding a subtracting the whole numbers and fraction parts should be sufficient? what'ch think
9
1584
by: Ross Olney | last post by:
Im starting a program that is supposed to take in polynomials from the user. From there they can add them, subract, multiply, or divide them. My question is more of the design. What would be a good way to design it be? I have a polynomial class and the only way Ive figured out to do this is put in add, subtract etc functions into the polynomial class and pass one polynomial to the other. But that doesnt seem very good. Seems...
17
12793
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
6
3659
by: Papa.Coen | last post by:
I've just spend a lot of time solving the following problem: I used dotNet 2.0 / Visualstudio 2005 / C# / aspx, enable viewstate is set on all controls. I have 2 listboxes; the left contains items that can be (dynamically) added to the right box. Adding the first item went fine, it shows up in the right box. Adding the second item resulted in losing _every_ control following the right box. 'View source' reveiled that the rendering of the...
19
11633
by: ashkaan57 | last post by:
Hi, I have a page in a right-to-left language and I am trying to make some bulleted lists using <ul>, but it puts the bullets to the left. Is there any way I can set the bullets to be on the right: ..lists { margin:2em 0 0 2em; } ..lists ul {
1
1622
by: Anthony Levensalor | last post by:
Hey guys! I'm writing a widget wherein I want the pages using it to be able to subscribe to events on it. I did my own research, not asking anyone to write it for me, just want to make sure I'm on the right track here. Basically, I'm creating a private collection of listeners, then providing a mechanism for adding functions to that event. A dispatch function loops through the listeners, finds the right one,
2
1689
by: rfdjr1 | last post by:
I'm using MS Access 2000. I have a small database to keep track of my lighthouse collection. Right now it's only two columns. I'd like to add a third. I'd like the new column to be the third column, that is, to the right of the others. Every time I try to insert a column, it ends up on the far left or in between the two existing columns. How do I add one on the right? Thanks.
1
2269
by: superDk | last post by:
Hello, IE6 is adding a large margin between my two containers (container1 & container2) everything works fine in IE7 and Firefox. I've been searching on-line for a fix but I've had no luck. It would make my day if someone could help me with this. website- http://www.00dogtraining.com/ Thanks for any help, Dave css code:
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.