Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Showing child menu instead of MDI Parent menu in vb.net

Showing child menu instead of MDI Parent menu in vb.net

Scheduled Pinned Locked Moved Windows Forms
csharptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dattatraya K
    wrote on last edited by
    #1

    Hello, I think this might be very silly question, However Can anybody tell me How to show the Child menu when only child is opened. The Scenario is If i opened the MDIParent then only menu on MDIParent is visible but as soon as i opened any child form the respective forms menu will be used instead of MDIParent menu. On closing child once again MDIParent menu is visible. Regards, Datta

    W 1 Reply Last reply
    0
    • D Dattatraya K

      Hello, I think this might be very silly question, However Can anybody tell me How to show the Child menu when only child is opened. The Scenario is If i opened the MDIParent then only menu on MDIParent is visible but as soon as i opened any child form the respective forms menu will be used instead of MDIParent menu. On closing child once again MDIParent menu is visible. Regards, Datta

      W Offline
      W Offline
      Wayne Gaylard
      wrote on last edited by
      #2

      The only way I can think of doing this, is by creating a local variable on your child forms, which exposes your parent form in the child. i.e. Private ParentForm as frmParent. You can pass this info through the constructor of your child form, and in the constructor set this variable like this

      Public Sub New(ByVal Parent As frmParent)
      
          ' This call is required by the Windows Form Designer.
          InitializeComponent()
          myParent = Parent
          ' Add any initialization after the InitializeComponent() call.
      
      End Sub
      

      Then in your FormLoad event you can set the menustripitems.visible on the parent to false. like this

          myParent.MenuStrip1.Items(0).Visible = False
          myParent.MenuStrip1.Items(1).Visible = False
      

      Not forgetting to set visible to true in your FromClosing Event. Hope this helps

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups