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. I want to do a control like vs2005 doc outline tool

I want to do a control like vs2005 doc outline tool

Scheduled Pinned Locked Moved C#
question
6 Posts 3 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.
  • H Offline
    H Offline
    hwswin
    wrote on last edited by
    #1

    ...f is a Form                   Control t_ctrl;                   for (int i = 0; i < f.Controls.Count; i++)                   {                         t_ctrl = f.Controls[i];                         TreeNode t_tn = new TreeNode(string.IsNullOrEmpty(t_ctrl.Text) ? t_ctrl.Name : t_ctrl.Text);                         t_tn.Tag = t_ctrl;                         self.treeView1.Nodes.Add(t_tn);                         addNode(t_ctrl, t_tn);                   } ...             private static void addNode(Control ctrl, TreeNode tn)             {                   Control t_ctrl;                   for (int i = 0; i < ctrl.Controls.Count; i++)                   {                         t_ctrl = ctrl.Controls[i];                         TreeNode t_tn = new TreeNode(string.IsNullOrEmpty(t_ctrl.Text) ? t_ctrl.Name : t_ctrl.Text);                         t_tn.Tag = t_ctrl;                         tn.Nodes.Add(t_tn);                         if (t_ctrl.Controls.Count != 0)                         { addNode(t_ctrl, t_tn); }                   }        &nb

    C 1 Reply Last reply
    0
    • H hwswin

      ...f is a Form                   Control t_ctrl;                   for (int i = 0; i < f.Controls.Count; i++)                   {                         t_ctrl = f.Controls[i];                         TreeNode t_tn = new TreeNode(string.IsNullOrEmpty(t_ctrl.Text) ? t_ctrl.Name : t_ctrl.Text);                         t_tn.Tag = t_ctrl;                         self.treeView1.Nodes.Add(t_tn);                         addNode(t_ctrl, t_tn);                   } ...             private static void addNode(Control ctrl, TreeNode tn)             {                   Control t_ctrl;                   for (int i = 0; i < ctrl.Controls.Count; i++)                   {                         t_ctrl = ctrl.Controls[i];                         TreeNode t_tn = new TreeNode(string.IsNullOrEmpty(t_ctrl.Text) ? t_ctrl.Name : t_ctrl.Text);                         t_tn.Tag = t_ctrl;                         tn.Nodes.Add(t_tn);                         if (t_ctrl.Controls.Count != 0)                         { addNode(t_ctrl, t_tn); }                   }        &nb

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You should use a foreach, and you should write a recursive method, because some controls, contain controls.

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      H 1 Reply Last reply
      0
      • C Christian Graus

        You should use a foreach, and you should write a recursive method, because some controls, contain controls.

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        H Offline
        H Offline
        hwswin
        wrote on last edited by
        #3

        Thanks for your reply I had already use the recursive method-->"addNode(Control ctrl, TreeNode tn)"

        S 1 Reply Last reply
        0
        • H hwswin

          Thanks for your reply I had already use the recursive method-->"addNode(Control ctrl, TreeNode tn)"

          S Offline
          S Offline
          S Senthil Kumar
          wrote on last edited by
          #4

          Controls inside a tool strip aren't available from the Controls property, you need to use the Items property instead.

          Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

          H 1 Reply Last reply
          0
          • S S Senthil Kumar

            Controls inside a tool strip aren't available from the Controls property, you need to use the Items property instead.

            Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

            H Offline
            H Offline
            hwswin
            wrote on last edited by
            #5

            So if I want to make it, I need to consider all those special controls, It's not a easy thing,right? Did anybody have idea about how display all controls in winfroms at runtime like vs2005 doc outline tool in designtime?

            S 1 Reply Last reply
            0
            • H hwswin

              So if I want to make it, I need to consider all those special controls, It's not a easy thing,right? Did anybody have idea about how display all controls in winfroms at runtime like vs2005 doc outline tool in designtime?

              S Offline
              S Offline
              S Senthil Kumar
              wrote on last edited by
              #6

              hwswin wrote:

              It's not a easy thing,right?

              As there's no common interface to access child controls, I'm afraid not.

              Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

              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