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. Database & SysAdmin
  3. Database
  4. Accessing mdiParent form menu from mdiChild form via code

Accessing mdiParent form menu from mdiChild form via code

Scheduled Pinned Locked Moved Database
questionhelp
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.
  • A Offline
    A Offline
    AussieLew
    wrote on last edited by
    #1

    I have main start up form call MainForm called as follows...

    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new MainForm());
    }

    On MainForm I have a MenuStrip with MenuItems and ToolStripMenuItems. Some of these ToolStripMenuItems have a property of CheckOnClick set to True. From MainForm I open another form called F1 based on HormoneTypeForm, as an MDI child...

    private void hormoneTypeToolStripMenuItem_Click(object sender, EventArgs e)
    {
    HormoneTypeForm f1 = new HormoneTypeForm();
    f1.MdiParent = this;
    hormoneTypeToolStripMenuItem.Enabled = false;
    f1.Show();
    }

    My question is - from form F1 I want to be able to get and set the Checked value of some of the ToolStripMenuItems on the MainForm menu. I cannot find anyway to reference the ToolStripMenuItems on MainForm from F1. I'm sure it simple but.....? Thanks for any help.

    L 1 Reply Last reply
    0
    • A AussieLew

      I have main start up form call MainForm called as follows...

      static void Main()
      {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new MainForm());
      }

      On MainForm I have a MenuStrip with MenuItems and ToolStripMenuItems. Some of these ToolStripMenuItems have a property of CheckOnClick set to True. From MainForm I open another form called F1 based on HormoneTypeForm, as an MDI child...

      private void hormoneTypeToolStripMenuItem_Click(object sender, EventArgs e)
      {
      HormoneTypeForm f1 = new HormoneTypeForm();
      f1.MdiParent = this;
      hormoneTypeToolStripMenuItem.Enabled = false;
      f1.Show();
      }

      My question is - from form F1 I want to be able to get and set the Checked value of some of the ToolStripMenuItems on the MainForm menu. I cannot find anyway to reference the ToolStripMenuItems on MainForm from F1. I'm sure it simple but.....? Thanks for any help.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I'm not sure what this has to do with "General Database" however ... In your hormoneTypeToolStripMenuItem_Click you will need to use a reference to your MainForm, either make it global or ensure this method is part of your MainForm. Also note that your HormoneTypeForm f1 will be destroyed as soon as this method returns; I doubt that is what you want.

      It's time for a new signature.

      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