Dynamically adjust height of SplitContainer's Panel

QuestionI have a SplitContainer which in the first panel, set horizontally, hosts a custom control. There are times where I want to hide the control and swap it out for a control of greater height. I can achieve the swapping of the controls but have been unable to have the panel/splitter adjust to the new size of the new control. Please advise.

Platform
  • .Net 2
  • C#

advTHANKSance
[587 byte] By [OmegaMan] at [2007-12-25]
# 1
Were you able to get the size of the panel control? If you are adding the new control dynamically then get the panel control size and
adjust the new control size based on panel size. Also, when are you creating the new custom control and how?

Thank you,
Bhanu.

BhanuPrakashNunna-MSFT at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
Nameste Bhanu,

Your advice is on target. I was hoping there was an automatic resize event when I made the control visible....I had both controls created at design time, overlaying each other, with one invisible.

OmegaMan at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...