473,396 Members | 1,998 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,396 software developers and data experts.

context menu question

Hi

I have a contextm enu on a form and called it - jobMenu and this is linked
to a datagrid
When the right mouse button is clicked the following code is called and the
menu displayed.

private void jobMenu_Popup(object sender, System.EventArgs e)

{

MenuItem menuItem1 = new MenuItem("Edit");

MenuItem menuItem2 = new MenuItem("Delete");

// Clear all previously added MenuItems.

jobMenu.MenuItems.Clear();

jobMenu.MenuItems.Add(menuItem1);

jobMenu.MenuItems.Add(menuItem2);

}

I cannot figure out what I do next, how do I call procedures when clicking
on the popup menu options,

Thanks in advance

Nov 16 '05 #1
1 1069
You need to set up event handlers for each menu item. If you use VS.NET this
is very simple, just double click on the menu item in the designer.

Thomas P. Skinner [MVP]

"Starbuck" <St******@tisconi.co.uk> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a contextm enu on a form and called it - jobMenu and this is linked
to a datagrid
When the right mouse button is clicked the following code is called and
the menu displayed.

private void jobMenu_Popup(object sender, System.EventArgs e)

{

MenuItem menuItem1 = new MenuItem("Edit");

MenuItem menuItem2 = new MenuItem("Delete");

// Clear all previously added MenuItems.

jobMenu.MenuItems.Clear();

jobMenu.MenuItems.Add(menuItem1);

jobMenu.MenuItems.Add(menuItem2);

}

I cannot figure out what I do next, how do I call procedures when clicking
on the popup menu options,

Thanks in advance

Nov 16 '05 #2

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

Similar topics

3
by: Eddie de Bear | last post by:
Hi, A project I am working on has a requirement for dynamic menus. For the most part this works really well. The menus I'm creating a based on files and directories, so naturally the menu...
2
by: Gustavo Franco | last post by:
Hi, Basic Question, difficult answer 1) Thread one; Open Context Menu.
4
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped...
4
by: Aaron Queenan | last post by:
How can I use the designer to add a context menu to a class which inherits from a control, e.g. treeview, without adding the context menu to a form? For example, to add a context menu with...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
13
by: Steven Smith | last post by:
Just a quick question... I've built a context menu which I want to pop-up when right clicking the form, I've set the Form's context menu property to the name of the menu in question, but it...
5
by: yxq | last post by:
Hi I am build vb6 Context menu extension, but how to determine which popup menu item(popupItem1 and popupItem2) was clicked? Thanks The code ' ' IContextMenu::QueryContextMenu '
1
by: Chris Murphy via DotNetMonster.com | last post by:
Hi all, I'm just wondering if any one can help me with this development issue I'm having. I've created a customized treeview control to handle the particular tasks to which I'll be using it. Within...
2
by: Ron M. Newman | last post by:
Hi, Just need a little advice. Id like to build *dynamic* context menus for tree nodes. I'm pretty versed in building context menus and attaching them to tree nodes. My question is, what...
1
by: Preeti | last post by:
Hi all I am a fresher and have been given a requirement in VB.net I have to make an application in VB.net which will run as a system tray icon and will add one or two items in the default...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...
0
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,...

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.