private void InitializeMyGcCheckedGroupBox()
{
// Set the header text by setting Text property.
this.gcCheckedGroupBox1.Text = "&Collapse All";
// Enable gcCheckedGroupBox1 to expand or collapse.
this.gcCheckedGroupBox1.HeaderType = HeaderType.ExpanderAndText;
// Create a top-line border group box.
this.gcCheckedGroupBox1.GroupStyle = GroupStyle.TopLine;
// Initialize the layout of items by LayoutSettings.
this.gcCheckedGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Table;
this.gcCheckedGroupBox1.LayoutSettings.Orientation = System.Windows.Forms.Orientation.Vertical;
this.gcCheckedGroupBox1.LayoutSettings.RowCount = 3;
this.gcCheckedGroupBox1.LayoutSettings.HorizontalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Distributed;
this.gcCheckedGroupBox1.LayoutSettings.VerticalAdjustment = GrapeCity.Win.Containers.LineAdjustment.Average;
this.gcCheckedGroupBox1.ItemCheckedChanged +=
new System.EventHandler<GrapeCity.Win.Containers.CheckBoxItemEventArgs>(this.gcCheckedGroupBox1_ItemCheckedChanged);
this.gcCheckedGroupBox1.HeaderStateChange +=
new System.EventHandler<GrapeCity.Win.Containers.HeaderStateChangeEventArgs>(this.gcCheckedGroupBox1_HeaderStateChange);
// Create and add some items.
CheckBoxItem[] items = new CheckBoxItem[]
{
new CheckBoxItem("item1"),
new CheckBoxItem("item2",true),
new CheckBoxItem("item3"),
new CheckBoxItem("item4", true),
new CheckBoxItem("item5", true),
};
this.gcCheckedGroupBox1.Items.AddRange(items);
}
Private Sub InitializeMyGcCheckedGroupBox()
' Set the header text by setting Text property.
Me.gcCheckedGroupBox1.Text = "&Collapse All"
' Enable gcCheckedGroupBox1 to expand or collapse.
Me.gcCheckedGroupBox1.HeaderType = HeaderType.ExpanderAndText
' Create a top-line border group box.
Me.gcCheckedGroupBox1.GroupStyle = GroupStyle.TopLine
' Initialize the layout of items by LayoutSettings.
Me.gcCheckedGroupBox1.LayoutSettings.LayoutMode = LayoutMode.Table
Me.gcCheckedGroupBox1.LayoutSettings.Orientation = System.Windows.Forms.Orientation.Vertical
Me.gcCheckedGroupBox1.LayoutSettings.RowCount = 3
Me.gcCheckedGroupBox1.LayoutSettings.HorizontalAdjustment = LineAdjustment.Distributed
Me.gcCheckedGroupBox1.LayoutSettings.VerticalAdjustment = LineAdjustment.Average
AddHandler Me.gcCheckedGroupBox1.ItemCheckedChanged, AddressOf gcCheckedGroupBox1_ItemCheckedChanged
AddHandler Me.gcCheckedGroupBox1.HeaderStateChange, AddressOf gcCheckedGroupBox1_HeaderStateChange
' Create and add some items.
Dim items As CheckBoxItem() = New CheckBoxItem() {New CheckBoxItem("item1"), New CheckBoxItem("item2", True), New CheckBoxItem("item3"), New CheckBoxItem("item4", True), New CheckBoxItem("item5", True)}
Me.gcCheckedGroupBox1.Items.AddRange(items)
End Sub