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

how to add items to main menu...

dynamicly, during the program execution - for example - if I press a
utton - to add MenuItem - "aaaaa" into the &File column, after Save and
before Save As? - and how to remove it as well?
Nov 16 '05 #1
1 1207
You need to get the main menu object which will contain a collection of
menuitems which will be your menus across the top of the screen.
Each menuitem contains a collection of menuitems which will be the menus
under that menu.
You can add to that collection at any index.

The following sample presumes you have a mainmenu with a menuitem calle
mnifile
//get the file menu

MenuItem FileMenu = this.mniFile;

//create a new menuitem

MenuItem NewItem = new MenuItem("NewItem");

//add the new menuitem at position 2 (will be third in the list)

FileMenu.MenuItems.Add(2, NewItem);

HTH

JB

"Bad_Kid" <RE*******************@yahoo.co.uk> wrote in message
news:c7**********@bagan.srce.hr...
dynamicly, during the program execution - for example - if I press a
utton - to add MenuItem - "aaaaa" into the &File column, after Save and
before Save As? - and how to remove it as well?

Nov 16 '05 #2

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

Similar topics

2
by: SamSpade | last post by:
I use to get popup events when I checked out the menu coding. That was a while ago. Something I did in the interim must have suppressed those events because I just noticed I don't get them any...
13
by: Rich B. | last post by:
I have an MDI form with a single child form. I have found a couple of circumstances that appear to cause the framework to leak Int32s, MenuItems, MenuItemCollections and sometimes...
2
by: Ludwig | last post by:
My application has a main tool strip menu (File, Options, help,...). There are also a number of context menu's that popup. Some main menu items should also be available in some context menu's. ...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
2
by: hosney | last post by:
Can anyone tell me how i can display the menus of the menu bar of the form in a popup menu? I can only get the submenu items of 1 main menu of the menu bar. This would be possible if there was a root...
13
by: Larry Bud | last post by:
Trying to conditionally remove menu items of the 2.0 .NET menu item control and I'm stumped. This removed a root level item: Menu1.Items.Remove(Menu1.FindItem("Administration")) But this...
2
by: Andrus | last post by:
To reproduce, run code, open file menu, press up and down arrows to move out of menu. Menu items are scrolled and blank items appears in end. I need to change visibility of menu items at...
6
by: PetterL | last post by:
I have in my program a menu that represent a setting set contained in a array. I planned to have the tag of each menutitem (0-4) to help the user to select right setting. How do i get the...
4
by: libish | last post by:
hi all... can any one help me by suggesting a way to get items in dynamic form? here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu contains...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.