In this topic, you will learn how to add multiple C1SplitterPanels to the C1SplitContainer control in design view and in code.
Complete the following steps:
Complete the following steps:
Visual Basic
Visual Basic |
Copy Code
|
---|---|
Imports C1.Win.C1SplitContainer |
To write code in C#
C# |
Copy Code
|
---|---|
using C1.Win.C1SplitContainer; |
Visual Basic
Visual Basic |
Copy Code
|
---|---|
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() Dim panel3 As New C1SplitterPanel() 'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) split.Panels.Add(panel3) panel1.Text = "Panel 1" panel2.Text = "Panel 2" panel3.Text = "Panel 3" 'add the splitcontainer Controls.Add(split) End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
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(); C1SplitterPanel panel3 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); split.Panels.Add(panel3); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; panel2.Text = "Panel 3"; //add the splitcontainer Controls.Add(split); } |
The following graphic depicts a C1SplitContainer control with three C1SplitterPanels.