Page Rank

Subscribe

Categories

Recent posts

Alexa Rank

Working of ContextMenuStrip control in C#


  • This topic helps to learn the working of ContextMenuStrip control in C#.

ContextMenuStrip control in C#

  • The ContextMenuStrip control provides a shortcut menu that you associate with a control.

ContextMenuStrip Control  in C# Overview

  • Shortcut menus, also called context menus, appear at the mouse position when the user clicks the right mouse button.
  • Shortcut menus provide options for the client area or the control at the mouse pointer location.

How to implement ContextMenuStrip in C# with controls?

  • After creating your controls and shortcut menus, use the following procedures to display a given shortcut menu when the user right-clicks the control.
  • These procedures associate a ContextMenuStrip with a Windows Form and with a ToolStrip control.

Step to add ContextMenuStrip control to form of your application

  • Step 1: Add or drag ContextMenuStrip Control to the form from toolbox
Working of ContextMenuStrip control in VB.NET - Adding ContextMenuStrip

Working of ContextMenuStrip control in C# – Adding ContextMenuStrip

  • Step 2: Click on ContextMenuStrip Control on the form and insert the field that needed when right click on any other controls


Working of ContextMenuStrip control in VB.NET - developing contextmenustrip

Working of ContextMenuStrip control in C# – developing contextmenustrip

  • Step 3: After adding Field, drag a TextBox control to the form, and select its properties and select ContextMenuStrip property and select your ContextMenuStrip (ContextMenuStrip1)
Working of ContextMenuStrip control in VB.NET - setting properties

Working of ContextMenuStrip control in VB.NET – setting properties

  • Step 4: Now click on ContextMenuStrip in C# and double click on any field that you give, for writing code

  • Step 5: Now right Click on the TextBox, now you can see the ContextMenuStrip and click any option that shown.
Working of ContextMenuStrip control in VB.NET - adding to textbox

Working of ContextMenuStrip control in C# – adding to textbox

Working of ContextMenuStrip control in VB.NET - Final result

Working of ContextMenuStrip control in C# – Final result

Imp:  For adding break between the name, just type “-“(without quotes).

If you have any doubts in ContextMenuStrip Control or any new topics to post in our site, please feel free to contact us..our mail id: codingangel@gmail.com

 

 

 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">