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. treeview and mdichild

treeview and mdichild

Scheduled Pinned Locked Moved C#
tutorialquestion
3 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.
  • G Offline
    G Offline
    ginji20
    wrote on last edited by
    #1

    can someone know how to put a code on a treeview node?? where can i find the mdichild form.. there is no mdi child form on the when i clicked project then add form.. ginji

    D 1 Reply Last reply
    0
    • G ginji20

      can someone know how to put a code on a treeview node?? where can i find the mdichild form.. there is no mdi child form on the when i clicked project then add form.. ginji

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Do you mean how to create a TreeNode in code and add it to a TreeView? If so:

      // This method has many options - check MSDN
      TreeNode node = new TreeNode("Node Text");
      treeView1.Nodes.Add(node);

      MDI children are just normal forms which is why there's no automatic MDIChildForm option. Set the parent form's IsMdiContainer property to true, and after you instanciate the child form, set it's MdiParent property to the parent form. i.e.

      Form2 form2 = new Form2();
      form2.MdiParent = this;
      form2.Show();

      Dave

      G 1 Reply Last reply
      0
      • D DaveyM69

        Do you mean how to create a TreeNode in code and add it to a TreeView? If so:

        // This method has many options - check MSDN
        TreeNode node = new TreeNode("Node Text");
        treeView1.Nodes.Add(node);

        MDI children are just normal forms which is why there's no automatic MDIChildForm option. Set the parent form's IsMdiContainer property to true, and after you instanciate the child form, set it's MdiParent property to the parent form. i.e.

        Form2 form2 = new Form2();
        form2.MdiParent = this;
        form2.Show();

        Dave

        G Offline
        G Offline
        ginji20
        wrote on last edited by
        #3

        i mean how to put a code in a node for example if i click node1 another form opens then if i click node2 the form is disabled... mdichild thanks i created a mdi child form can i also how can i close the mdichild form and goes back to the mdiparent because if i hide the mdichild the mdiparent also hides.

        modified on Wednesday, June 25, 2008 9:27 PM

        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