save size after using splitter

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,
I have a panel docked to the bottom of my form. This panel can be
expanded vertically by clicking on a button. When the user click on the
button again, the panel is then collapsed. The panel has a horizontal
splitter, which the user can use to resize the panel when it is
expanded. I would like to save the height of the panel when the user
uses the splitter, so that when the panel is expanded via the button,
it size will be automatically set to the one the user had set.
Unfortunately I don't know on which event of the splitter I should
store the new size?

Can you help?
Thx
 
You could use the SplitPosition property of the Splitter class to get the
height of the panel.

-Atul, Sky Software http://www.ssware.com
Shell MegaPack ActiveX & .Net
Drop In Windows Explorer like Shell Browsing GUI controls for your app.
 
Sam said:
Hi,
I have a panel docked to the bottom of my form. This panel can be
expanded vertically by clicking on a button. When the user click on
the button again, the panel is then collapsed. The panel has a
horizontal splitter, which the user can use to resize the panel when
it is expanded. I would like to save the height of the panel when
the user uses the splitter, so that when the panel is expanded via
the button, it size will be automatically set to the one the user
had set. Unfortunately I don't know on which event of the splitter I
should store the new size?

Have a look @ these groups for language unrelated questions:
microsoft.public.dotnet.framework.windowsforms[.*]


Armin
 
Sam said:
I have a panel docked to the bottom of my form. This panel can be
expanded vertically by clicking on a button. When the user click on the
button again, the panel is then collapsed. The panel has a horizontal
splitter, which the user can use to resize the panel when it is
expanded. I would like to save the height of the panel when the user
uses the splitter

Save the value of the splitter control's 'SplitPosition' property and
restore it later. You don't need to store the size of the controls
connected by the splitter.
 
Sam,
In addition to the other comments.

A cursory glance at Splitter in VS.NET's Object Browser suggests:

Splitter.SplitPosition - the current position of the splitter.

Splitter.SplitterMoved - current position of the splitter moved.

Splitter.SplitterMoving - the current position of the splitter is about to
move.

Checking on-line help confirms the above.

http://msdn.microsoft.com/library/d...ndowsformssplitterclasssplitpositiontopic.asp

http://msdn.microsoft.com/library/d...ndowsformssplitterclasssplittermovedtopic.asp

http://msdn.microsoft.com/library/d...dowsformssplitterclasssplittermovingtopic.asp

Hope this helps
Jay

| Hi,
| I have a panel docked to the bottom of my form. This panel can be
| expanded vertically by clicking on a button. When the user click on the
| button again, the panel is then collapsed. The panel has a horizontal
| splitter, which the user can use to resize the panel when it is
| expanded. I would like to save the height of the panel when the user
| uses the splitter, so that when the panel is expanded via the button,
| it size will be automatically set to the one the user had set.
| Unfortunately I don't know on which event of the splitter I should
| store the new size?
|
| Can you help?
| Thx
|
 
Back
Top