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. WPF
  4. Adjusting Panels in WPF programatically ?

Adjusting Panels in WPF programatically ?

Scheduled Pinned Locked Moved WPF
csharphelpwpftutorialquestion
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.
  • K Offline
    K Offline
    Krishna Aditya
    wrote on last edited by
    #1

    Hi, I am working on WPF controls, I have a halt at adjusting one of the controls programatically. I have 2 radiobuttons (rdbtn1, rdbtn2) and a dockpanel(2 controls) with a stackpanel(with textbox and button)a another stackpanel(with 2 textboxes). so the panels are placed at (40,10,0,0) and (40,150,0,0) with panel1 above and panel2 below it. actually the problem is selecting one of radiobuttons . if i select rdbtn2, the panel1 shuld be invisible and the panel2 should stretch (not shift, which mean if the panel2 height is 200 and it should stretch its starting point in vertical to 10 and its lower limit should be same , making total height of 140 + 200 )to the panel1 starting location . so, only panel2 shuld be visible. how to do this programatically in C#? Please help.. Thank you, Ramm

    C 1 Reply Last reply
    0
    • K Krishna Aditya

      Hi, I am working on WPF controls, I have a halt at adjusting one of the controls programatically. I have 2 radiobuttons (rdbtn1, rdbtn2) and a dockpanel(2 controls) with a stackpanel(with textbox and button)a another stackpanel(with 2 textboxes). so the panels are placed at (40,10,0,0) and (40,150,0,0) with panel1 above and panel2 below it. actually the problem is selecting one of radiobuttons . if i select rdbtn2, the panel1 shuld be invisible and the panel2 should stretch (not shift, which mean if the panel2 height is 200 and it should stretch its starting point in vertical to 10 and its lower limit should be same , making total height of 140 + 200 )to the panel1 starting location . so, only panel2 shuld be visible. how to do this programatically in C#? Please help.. Thank you, Ramm

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

      I would put them in a stackpanel or a grid, and try to set them up so their size is determined by the available space, so that when you collapse one, the other would fill the space.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      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