[]
You can easily widen the splitter bar using the SplitterWidth property. In this topic, you will learn how to set the SplitterWidth property in design view and in code.
Complete the following steps:
Add the C1SplitContainer to the form.
Click on the C1SplitContainer’s smart tag to open its tasks menu.
Select Add Panel once to add another panel to the C1SplitContainer control.
In the C1SplitContainer Properties window, set the SplitterWidth property to “40”.
Complete the following steps:
Add the C1.Win.C1SplitContainer.dll reference to your project.
Declare the following C1.Win.C1SplitContainer namespace at the top of your code page:
Imports C1.Win.C1SplitContainer
using C1.Win.C1SplitContainer;
Add the following code in the Form_Load event:
Private Sub Form1_Load(sender As Object, e As EventArgs)
'create new splitcontainer
Dim split As New C1SplitContainer()
'create a new panel for the split container
Dim panel1 As New C1SplitterPanel()
Dim panel2 As New C1SplitterPanel()
'add the panels to the splitcontainer
split.Panels.Add(panel1)
split.Panels.Add(panel2)
panel1.Text = "Panel 1"
panel2.Text = "Panel 2"
'set the splitter width to 40 pixels
Split.SplitterWidth = 40
'add the splitcontainer
Controls.Add(split)
End Sub
private void Form1_Load(object sender, EventArgs e)
{
//create new splitcontainer
C1SplitContainer split = new C1SplitContainer();
//create a new panel for the split container
C1SplitterPanel panel1 = new C1SplitterPanel();
C1SplitterPanel panel2 = new C1SplitterPanel();
//add panel1 to the splitcontainer
split.Panels.Add(panel1);
split.Panels.Add(panel2);
panel1.Text = "Panel 1";
panel2.Text = "Panel 2";
//set the splitter width to 40 pixels
split.SplitterWidth = 40;
//add the splitcontainer
Controls.Add(split);
}
Run the program.
This topic illustrates the following:
The following image displays a vertical C1SplitContainer with its SplitterWidth property set to 40 pixels: