On Mar 9, 1:00 pm, "JDeats" <Jeremy.De...@gmail.comwrote:
I have a simple WinForm with a WinForms splitter down the middle. I
would like to make it so when the user clicks on a button inside the
left portion of the screen (the panel to the splitters left) that
portion of the form is reduced in size by about 90% (I want to shrink
this area of the of the form).
The splitter doesn't appear to have any methods for programmatic
resizing, I tried changing it's width settings and the splitter moved
without moving the controls inside it.
To resize a Splitter you can use the Splitters "SplitPosition"
attribute. You can increase or decrease this value to move the
splitter different directions depending on how it is docked to your
form. If you want to reduce a panel that is controlled by a splitter
by 90% I would do the following.
splitter1.SplitPosition = (int)((double)splitter1.SplitPosition * .1);
and that will reduce it by 90% assuming this isn't less than the
MinSize of the splitter. Let me know if you have any problems using
this code.
~ Justin Creasy
www.immergetech.com www.immergecomm.com