Solved

contextMenuStrip

Posted on 2011-02-27
11
384 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
ID: 34993596
here the vid tutorial for contect menu:

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

Expert Comment

by:Kalpesh Chhatrala
ID: 34994023
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 34994955
Hi,

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

Asim
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

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

Expert Comment

by:Asim Nazir
ID: 34997373
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
 

Author Comment

by:ziayd2009
ID: 34999598
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
ID: 35004393
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
ID: 35043562
when i clicking C
i want  show text in textbox
LIKE IN PICTURE
bmE.JPG
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35053361
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
ID: 35087627
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
ID: 35091874
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Write to a printer using vb.net 9 38
vb.net class 3 21
Complex SQL statement in VB.NET 7 31
Need syntax help building hyperlink 2 22
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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