Solved

contextMenuStrip

Posted on 2011-02-27
11
375 Views
Last Modified: 2012-05-11
i want examples about contextMenuStrip
how i use in my form and benefit of it
0
Comment
Question by:ziayd2009
11 Comments
 
LVL 10

Expert Comment

by:himanshut
Comment Utility
here the vid tutorial for contect menu:

http://www.youtube.com/watch?v=nFyH0McZz18
0
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
Comment Utility
0
 
LVL 10

Expert Comment

by:Asim Nazir
Comment Utility
Hi,

Follow this http://en.csharp-online.net/Create_and_configure_a_ContextMenuStrip
You can also download sample application.

Asim
0
 

Author Comment

by:ziayd2009
Comment Utility
sory but i work in visaul basic 2005 staudio
win aplaction
0
 
LVL 10

Expert Comment

by:Asim Nazir
Comment Utility
Mainly, ContextMenu provides you ease of use.

Here are steps to use Context menu:

1. drag and drop contextmenustrip on the form.
2. Select the control/form and in the properties set ContextMenu property to your dropped contextmenustrip. It should be available in the Dropdown for ContextMenu property.
3. Add some items to contextmenu.
4. add events to menu item by double clicking it or by using events window.

Please see the screen shot attached.

 Adding context menu to form
Let me know what else you need.
Asim
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:ziayd2009
Comment Utility
ok this great
but i great Context Menu have 3 itimes and textbox
in Context Menu  items
1-A
2-B
3-c
when i do rghit click in textbox show 3 items
how i get A orB or C in textbox
EX. when i do rghit click in textbox show Context Menu 3  items
i click  on c
textbox text is = c
0
 
LVL 10

Expert Comment

by:Asim Nazir
Comment Utility
On clicking C, you want to set Textbox's text to C or you want to show text in textbox on some label/message box?
0
 

Author Comment

by:ziayd2009
Comment Utility
when i clicking C
i want  show text in textbox
LIKE IN PICTURE
bmE.JPG
0
 
LVL 10

Expert Comment

by:Asim Nazir
Comment Utility
Handle context menu item click event and do further processing there...
You can do this by double clicking C item. This will add event handler to you code file and then you can set text to textbox in that handler.

Let me know if you need further help.
Asim
0
 

Author Comment

by:ziayd2009
Comment Utility
i use tihse ccde
Me.TextBox1.Text = Me.ContextMenuStrip1.Text
but nothing appear in textbox
0
 
LVL 10

Accepted Solution

by:
Asim Nazir earned 50 total points
Comment Utility
it works in first attempt. Make sure you are adding this code in ContxtMenuItem's click event - as given below:

private void cToolStripMenuItem_Click(object sender, EventArgs e)
        {
            textBox1.Text = cToolStripMenuItem.Text;
        }

Let me know if you need further help.
Asim
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now