473,396 Members | 1,764 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.

Dynamically adding menu items

MJ
I want to be able to add menu items at run time. I know how to add the
actual item but can't work out how to add the event handler.

Any help would be appreciated.

MJ
Sep 18 '06 #1
1 1614
menuItem.Click += new
System.EventHandler(YourPredefinedEvenClickEvent);

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money publishing .NET articles at
http://www.eggheadcafe.com


"MJ" <no******@belmont.co.ukwrote in message
news:12*************@corp.supernews.com...
>I want to be able to add menu items at run time. I know how to add the
actual item but can't work out how to add the event handler.

Any help would be appreciated.

MJ

Sep 19 '06 #2

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

Similar topics

0
by: Claire | last post by:
When I run the following code through on the first round, my sub-menu (branched off mnuOpenPorts menuitem) shows a nice list of ports. When it gets run through on the 2nd pass, the sub menu...
1
by: Joe | last post by:
I have a MenuItem which is was added to the context menu at design time. The context menu is for a button on a toolbar. At runtime I add and remove sub-menuitems to and from this menu item. The...
10
by: tmaster | last post by:
When I try to dynamically add a second sub menu item to this ContextMenu item, I get an error 'Specified argument was out of the range of valid values'. Private Sub mnuTopics_Show_Select(ByVal...
2
by: jack | last post by:
Hello, I need to dynamically add menu items to an existing menu on an MDI form. In the form load, when I create the menu items then add it to the menu control using the Add method, the entire...
7
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the...
12
by: Steve_Black | last post by:
I posted a similar message earlier but we've geared away from the original topic somewhat so I thought I'd post again in hopes of getting input from others. I am creating a MenuStrip...
0
by: Przemek | last post by:
Hi, I'm trying to create menu dynamically (populated with dataset). I want to have it inside my div, which is inside another div and inside contentplaceholder. Unfortunately I'm receiving null...
4
windows_mss
by: windows_mss | last post by:
When I Select Source & Destination Dynamically, Path Getting Scatter Across The Map... hi, i can able to get the Correct Route and Path for the corresponding Source and destination, like...
0
by: Puja | last post by:
hi all, I have asp.net menu control on my page. I want to hide some menu and sub-menu items dynamically depending on user. (i.e after user is logged in) is there any property like ...
6
by: Luqman | last post by:
How can I dynamically Add menuStrip and its menuItems through code using VB.Net 2005 ? Best Regards, Luqman
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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...
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.