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

Is there a Menu item maximum count?

Is there a maximum number of menu items that can be added to a single form?
If there is no maximum, that would help eliminate one possible source of the
problem.

I had six main menu items in the menu bar. After adding about 500 submenu
items to the first four main menu items, the last two menu items have now
disappeared. They are still there in the generated component code, but do
not appear in the designer. I suspect that something got hosed during the
process of adding submenu items, and dragging submenu items around.

Here is one of a dozen similar pieces of problematic-looking (to me) code:
Me.mnuServiceFosterTableCaretaker.Index = -1

Me.mnuServiceFosterTableCaretaker.Text = "Caretaker Type"

Any suggestions?

Dean Slindee


Nov 20 '05 #1
2 2513
Redesign your app ;-)
"Dean Slindee" <sl*****@mindspring.com> schrieb im Newsbeitrag
news:eI*************@tk2msftngp13.phx.gbl...
Is there a maximum number of menu items that can be added to a single form? If there is no maximum, that would help eliminate one possible source of the problem.

I had six main menu items in the menu bar. After adding about 500 submenu
items to the first four main menu items, the last two menu items have now
disappeared. They are still there in the generated component code, but do
not appear in the designer. I suspect that something got hosed during the
process of adding submenu items, and dragging submenu items around.

Here is one of a dozen similar pieces of problematic-looking (to me) code:
Me.mnuServiceFosterTableCaretaker.Index = -1

Me.mnuServiceFosterTableCaretaker.Text = "Caretaker Type"

Any suggestions?

Dean Slindee

Nov 20 '05 #2
Hello Dean,

Thanks for posting in the group.

now the question is: You have six main menu items in the menu bar. After
adding about 500 submenu to the first four main menu items, the last two
main menu items disappear. You want to know whether there is a maximum
count number of menu item in .NET winform application, right?

Based on my experience, there is no such limitation in .NET programming. I
did a quick test on a C# winform application and add 500 sub menu items to
the first menu. It won't affect other menus. The sample code is:

public void AddMenu()
{
MainMenu mnuFileMenu = new MainMenu();
this.Menu = mnuFileMenu;
MenuItem myMenuItemFile = new MenuItem("&File");
mnuFileMenu.MenuItems.Add(myMenuItemFile);
MenuItem myMenuItemEdit = new MenuItem("&Edit");
mnuFileMenu.MenuItems.Add(myMenuItemEdit);
MenuItem myMenuItemOption = new MenuItem("&Option");
mnuFileMenu.MenuItems.Add(myMenuItemOption);
MenuItem myMenuItemHelp = new MenuItem("&Help");
mnuFileMenu.MenuItems.Add(myMenuItemHelp);
MenuItem myMenuItemTest = new MenuItem("&Test");
mnuFileMenu.MenuItems.Add(myMenuItemTest);

MenuItem myMenuItemNew1 = new MenuItem("&New");
myMenuItemFile.MenuItems.Add(myMenuItemNew1);
MenuItem myMenuItemNew2 = new MenuItem("&New");
myMenuItemEdit.MenuItems.Add(myMenuItemNew2);
MenuItem myMenuItemNew3 = new MenuItem("&New");
myMenuItemOption.MenuItems.Add(myMenuItemNew3);
MenuItem myMenuItemNew4 = new MenuItem("&New");
myMenuItemHelp.MenuItems.Add(myMenuItemNew4);
MenuItem myMenuItemNew5= new MenuItem("&New");
myMenuItemTest.MenuItems.Add(myMenuItemNew5);
for (int i=0; i< 500; i++)
{
MenuItem myMenuSubItemTest = new MenuItem("&TestSubMenuItem"+i.ToString
());
myMenuItemFile.MenuItems.Add(myMenuSubItemTest);
}
}

I am not sure of why you need so many menu items. However, based on my
experience, this is not a convenient UI for users. I think it is better if
you could redesign the structure of them to see if you could merge some
setting in forms or somewhere.

If the problem still happens on your side, could you please create a small
repro sample and email it to me? I will look into it on my side. You can
reach me by removing online from my email address here.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3

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

Similar topics

22
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
4
by: Claire | last post by:
Sorry Ive added this twice (sortof) but if I'd added an addendum to the first one then this would probably have been ignored. This problem affects a ContextMenu attached to a NotifyIcon object. I...
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...
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 '
8
by: Sameh Ahmed | last post by:
Hello there i have a context menu linmked to a listview control. I want the context mnu to appear ONLY when i right click on an item and not any place in listview. any ideas? Thanks in advance....
3
by: WhiteWizard | last post by:
I have an Windows app that allows users to save "bookmarks", on pages they have been to, and then navigate back to them. That all works. In addition, we have restricted them to 15 bookmarks, and if...
0
by: Wayne Erfling | last post by:
I put in the code below to disable self links in a menu control in a "master" page. It works properly if the top-level menu item has no children, but both ..Selected = false and .NavigateUrl =...
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...
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.