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. C#
  4. MDI PARENT PROPERTY

MDI PARENT PROPERTY

Scheduled Pinned Locked Moved C#
questioncsharphelp
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
    ASGill
    wrote on last edited by
    #1

    Hi. im new to c# so pls bear with me and teach me..... i have created an MDI app, so i have three forms. frmMain , frmChild1 and frmChild2. in frmMain i have a button which will call frmChild2.. button click event { frmChild2 c2 = new frmChild2(); this.MdiParent(); c2.Show(); } and in frmChild2 i have a button callin frmChild3(this is also a child of frmMain) button click event { frmChild3 c3 = new frmChild3(); /* how do i assign frmMain as the parent form?... */ c3.Show(); } i also have another problem when i click the button twice, two identical forms pop up...how do i check to see if the form is already open, just direct the user to it and if its closed then open one?... :doh:

    S 1 Reply Last reply
    0
    • A ASGill

      Hi. im new to c# so pls bear with me and teach me..... i have created an MDI app, so i have three forms. frmMain , frmChild1 and frmChild2. in frmMain i have a button which will call frmChild2.. button click event { frmChild2 c2 = new frmChild2(); this.MdiParent(); c2.Show(); } and in frmChild2 i have a button callin frmChild3(this is also a child of frmMain) button click event { frmChild3 c3 = new frmChild3(); /* how do i assign frmMain as the parent form?... */ c3.Show(); } i also have another problem when i click the button twice, two identical forms pop up...how do i check to see if the form is already open, just direct the user to it and if its closed then open one?... :doh:

      S Offline
      S Offline
      Sabyasachi Bose
      wrote on last edited by
      #2

      At the button click event in form2 use objfrm3=new frm3(); objfrm3.MdiParent=this.MdiParent;//Assigns Parent of frm2 as parent of frm3 objfrm3.Show(); and regarding your problem of multiple forms opening use a counter to count no of instances of form and before instantiating check the value of the counter

      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