dcsimg
Results 1 to 11 of 11

Thread: My program's menu bar has disappeared

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    My program's menu bar has disappeared

    The items in my program's menu bar is no longer showing up, either in the IDE or when I run the program. The menu items still show up in the designer file, but they are no longer listed in the MenuStrip1 collection. How could they have accidentally been removed and how can I add them back in?

    PS the menu strip on another form in the same program is working just fine.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,495

    Re: My program's menu bar has disappeared

    What happens when you replace the menustrip with the working menustrip on the different form?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: My program's menu bar has disappeared

    You mean just by copying and pasting? It shows up, but it's not the right menu bar for that form.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,495

    Re: My program's menu bar has disappeared

    PS the menu strip on another form in the same program is working just fine.
    I guess I just assumed that they were. That's what happens when you assume huh :P. I guess my follow up question would be, are the click events for the menustripitems still there?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: My program's menu bar has disappeared

    Yes, the click events are all still there and they still have their handles. (Sorry, should have specified that the menu bars weren't the same.)

  6. #6
    Lively Member
    Join Date
    Feb 2012
    Posts
    90

    Re: My program's menu bar has disappeared

    Happens to me sometimes, not sure why. but the control visible gets set to false. Try clicking on any control and at the top of the properties there is a drop down box that will display all your controls for that form. Find you menu strip and select it. This should now display it. Then check the visible properties to see if its false or not.

    Pat

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: My program's menu bar has disappeared

    The menu strip visibility is true. So are the visibilities of all the menu items. The menu items have just been removed from the menu strip, and I don't know why or how to add them back.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: My program's menu bar has disappeared

    Also, if it were just a visibility issue, then they would show up in the IDE (just not when the program was running). But they aren't visible anywhere.

  9. #9
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,495

    Re: My program's menu bar has disappeared

    If you still have the event's in your code(F7), then I don't see the big deal in adding a new menustrip and copy and pasting the codes in the new handlers. Something happened, where accidental or not, and your menustrip isn't there anymore.

  10. #10
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,250

    Thumbs up Re: My program's menu bar has disappeared

    Quote Originally Posted by colleen.boye View Post
    The items in my program's menu bar is no longer showing up, either in the IDE or when I run the program. The menu items still show up in the designer file, but they are no longer listed in the MenuStrip1 collection. How could they have accidentally been removed and how can I add them back in?

    PS the menu strip on another form in the same program is working just fine.

    The last time it happened to me with a MenuStrip I compared the forms designer file to a working backup and found a few lines were missing (colored red) such as, SuspendLayout(), Items.AddRange, Text =, ResumeLayout and PerformLayout...

    Code:
    ' missing lines in "Form1.Designer.vb" compared to backup,
    
    Private Sub InitializeComponent()
      Me.MenuStrip1.SuspendLayout()
    
    'MenuStrip1
      Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MnuFile, Me.MnuCode, Me.Mnu2WordSearch})
      Me.MenuStrip1.Text = "MenuStrip1"
    
    'Form1
      Me.MenuStrip1.ResumeLayout(False)
      Me.MenuStrip1.PerformLayout()
    It seemed to happen when I was editing the menus images and/or adding more images to my resources, (not really sure) but its def a bug! (VB10 here).
    Last edited by Edgemeal; Sep 20th, 2012 at 12:10 AM. Reason: colored missing lines

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    152

    Re: My program's menu bar has disappeared

    Edgemeal: Perfect, that fixed the problem (I also needed to do the same thing for several of the menu items).

    (Just rebuilding the menustrip doesn't work because the menu items still exist so it won't let me add new ones with the same names.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width