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. Selected TreeView Item

Selected TreeView Item

Scheduled Pinned Locked Moved C#
helpcsharpc++tutorialvisual-studio
3 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.
  • A Offline
    A Offline
    Alan Martinis
    wrote on last edited by
    #1

    Hi, please help me if you know how… Something is bothering me - something that I didn't know how to handle it using Visual C++, therefore I don't know how to do it now with C#. Description: I have form with SplitContainer control on it, where on the left side I have TreeView control, and on the right side, I would like (depending on selected item in TreeView ctrl) to have different set of other controls (buttons, editBox,…etc.) Correct me if I'm wrong – the only easiest way that came up my mind is PANNEL control. Number of panels should be the same as number of items in the TreeView control. After on in the application, depending of selected item, I can use method .Hide() or .Show() to manipulate those panels. Example For example I have 20 items in TreeView control, therefore I should have 20 different panels. Furthermore, when I have 20 panels on the same form, and each of them is covering right side of SplitContainer (complete area), the only panel I can see is the latest one (twentieth). With this „panel“ concept, issue I found here is in the case if I have to change something on the third panel (e.g. to add new checkBox on it) . How to reach third panel? Do I have to move 17 panels to one side in order to reach third one (to be visible to work on it)? I believe that there should be something more elegantly – but I don't know what? I use SharpDevelop, but if you know that solution for my problem have solution in Visual Studio, please suggest! Great example will be Computer Management Console. If you click on “Removable Storage” or “Disk Defragmenter” or any other item in TreeView control, depending on it on the right side you will have respectively related set of controls. Thanks, Alan

    R B 2 Replies Last reply
    0
    • A Alan Martinis

      Hi, please help me if you know how… Something is bothering me - something that I didn't know how to handle it using Visual C++, therefore I don't know how to do it now with C#. Description: I have form with SplitContainer control on it, where on the left side I have TreeView control, and on the right side, I would like (depending on selected item in TreeView ctrl) to have different set of other controls (buttons, editBox,…etc.) Correct me if I'm wrong – the only easiest way that came up my mind is PANNEL control. Number of panels should be the same as number of items in the TreeView control. After on in the application, depending of selected item, I can use method .Hide() or .Show() to manipulate those panels. Example For example I have 20 items in TreeView control, therefore I should have 20 different panels. Furthermore, when I have 20 panels on the same form, and each of them is covering right side of SplitContainer (complete area), the only panel I can see is the latest one (twentieth). With this „panel“ concept, issue I found here is in the case if I have to change something on the third panel (e.g. to add new checkBox on it) . How to reach third panel? Do I have to move 17 panels to one side in order to reach third one (to be visible to work on it)? I believe that there should be something more elegantly – but I don't know what? I use SharpDevelop, but if you know that solution for my problem have solution in Visual Studio, please suggest! Great example will be Computer Management Console. If you click on “Removable Storage” or “Disk Defragmenter” or any other item in TreeView control, depending on it on the right side you will have respectively related set of controls. Thanks, Alan

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      Change the z-order of the panels as needed; to show the third panel: Panel3.BringToFront();

      1 Reply Last reply
      0
      • A Alan Martinis

        Hi, please help me if you know how… Something is bothering me - something that I didn't know how to handle it using Visual C++, therefore I don't know how to do it now with C#. Description: I have form with SplitContainer control on it, where on the left side I have TreeView control, and on the right side, I would like (depending on selected item in TreeView ctrl) to have different set of other controls (buttons, editBox,…etc.) Correct me if I'm wrong – the only easiest way that came up my mind is PANNEL control. Number of panels should be the same as number of items in the TreeView control. After on in the application, depending of selected item, I can use method .Hide() or .Show() to manipulate those panels. Example For example I have 20 items in TreeView control, therefore I should have 20 different panels. Furthermore, when I have 20 panels on the same form, and each of them is covering right side of SplitContainer (complete area), the only panel I can see is the latest one (twentieth). With this „panel“ concept, issue I found here is in the case if I have to change something on the third panel (e.g. to add new checkBox on it) . How to reach third panel? Do I have to move 17 panels to one side in order to reach third one (to be visible to work on it)? I believe that there should be something more elegantly – but I don't know what? I use SharpDevelop, but if you know that solution for my problem have solution in Visual Studio, please suggest! Great example will be Computer Management Console. If you click on “Removable Storage” or “Disk Defragmenter” or any other item in TreeView control, depending on it on the right side you will have respectively related set of controls. Thanks, Alan

        B Offline
        B Offline
        beatles1692
        wrote on last edited by
        #3

        Hi I suggest that you have a user control for each of your panels.This way you can work on them in their own designer. You can have a rhs panel on your form and while in runtime add the desired user control to this panel(setting its DockStyle to Fill) and remove previously added user control from this panel. Regrads

        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