SpitContainer is windows .net control which consists of a movable bar that divides a container’s display area into two resizable panels.
we can use the Orientation property to specify Orientation to be horizontal or vertical. The default orientation of the SplitContainer is vertical.
we can use the split container for the features such as collapse,expand.
Coding :
int LastSplitterDistance = 0; int tmp = this.splitContainer1.SplitterDistance; this.splitContainer1.SplitterDistance = LastSplitterDistance; LastSplitterDistance = tmp;
Here we make the splitter distance property of spitcontanier to 0 to collapse.Making the splitter distance to 0 will collapse panel1 only.
You cannot change the heigth of each panel explicitly.If you do you get a error as below.
“The SplitterPanel’s height cannot be set explicitly. Set the SplitterDistance on the SplitContainer instead.”
Sample : DownloadZip
Popularity: 5% [?]

September 10th, 2008
admin
Posted in
Tags:

