?
Solved

Menustrip items won't display in VS2008

Posted on 2009-04-08
15
Medium Priority
?
496 Views
Last Modified: 2013-11-26
I have added a menustrip to a windows form like I have done in the past but this time the items on the menu will not display at runtime.  I had at first forgotten to set the form's MainMenuStrip property but then went back and set it to the menustrip.  The items still won't display.  Any ideas?
0
Comment
Question by:pigparent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24105165
I am sure you have added items to the menu itself and they are set to be visible.
0
 
LVL 1

Author Comment

by:pigparent
ID: 24105573
Yes.  Below is the code from the designer.
        'menuPOs
        '
        Me.menuPOs.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.itemActions, Me.itemReports})
        Me.menuPOs.Location = New System.Drawing.Point(0, 0)
        Me.menuPOs.Name = "menuPOs"
        Me.menuPOs.Size = New System.Drawing.Size(727, 24)
        Me.menuPOs.TabIndex = 22
        Me.menuPOs.Text = "menuPOs"

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24105604
I just recreated the scenario. Draged and Dropped a menustrip to the form. Added the menu text and then an item' text. Set the form's mainmenu property to menustrip1. Run the project and the menu appears as expected. I cant think of anything else stopping the menu from displaying.
0
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 
LVL 1

Author Comment

by:pigparent
ID: 24106316
Thanks.  I was trying to avoid deleting it and starting over since I had a good bit of work invested in it, but I may have to try that.  I actually had tried adding a menu to another form in the application (again, to avoid all that work) and got the same result:  it just shows a blank gray bar at the top of the form.  If I get time later today I'll try deleting it and re-adding it, but like I say, since it's not working in the other form I don't expect that to solve the problem.

I really appreciate your attempt to help me!
0
 
LVL 1

Author Comment

by:pigparent
ID: 24106548
I have since tried three times to add a menustrip to another form in the project.  Each time it automatically adds the menustrip to the MainMenuStrip property (which it did not do on my other form) but it still won't display the items.  If I knew how, I'd bump up the points on this one because I see now this answer isn't so simple.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24110639
Try creating a new project from scratch.
0
 
LVL 1

Author Comment

by:pigparent
ID: 24129333
...and import all my objects into the new project, right?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24135855
No just to test whether this problem is only with the existing project or whether its something wrong with the VS or system configuration.
0
 
LVL 1

Author Comment

by:pigparent
ID: 24136621
Thanks, I came to VS from the Access world and that solves a lot of Access corruption so my mind went straight to that.

I just created a new project, tried it out, and it works fine in the test application.
0
 
LVL 1

Author Comment

by:pigparent
ID: 24136671
I just figured out what it's doing, but not yet sure why it's doing it.  It's showing the gray bar for the menu on the form, but it's adding the items to the MainMenuStrip on the MDI parent form.  This is not what I want it to do.  I want it to add the items on the child form.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24136756
This is how it works. Use the AllowMerge property

http://bytes.com/groups/net-c/435971-menustrip-mdi-merge
0
 
LVL 1

Author Comment

by:pigparent
ID: 24136864
Wow, that's really undesirable.  My child forms are fixed sizes because they're not large enough to need gobs of real estate.  I would like for them to have their own menu bars...where the users will intuitively look for them.  Is there no way to do that and skip the merge?

Thanks for your time!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24136896
Yes you can stop the menus from merging by setting the allow merge to false. By the way, the menu would only merge when you maximize the child forms, i think.
0
 
LVL 1

Author Closing Comment

by:pigparent
ID: 31568065
Thanks for your help!
0
 
LVL 1

Author Comment

by:pigparent
ID: 24136908
I was just coming back to post that I had discovered that.  I awarded points on your previous response because you led me to the correct answer.  It is working PERFECTLY now...thanks!
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question