// Please use the following namespace
// using System.Windows.Forms;
// using System.Drawing;
// using GrapeCity.Win.Editors;
public void SetGcListStyles()
{
// Creates the GcListBox control.
GcListBox gcListBox1 = new GcListBox();
// Creates a GradientEffect object.
GradientEffect gradienteffect = new GradientEffect();
gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side;
gradienteffect.EndColor = Color.FromArgb(224, 224, 224);
// Sets the header panel
gcListBox1.ListHeaderPane.AutoHeight = false;
gcListBox1.ListHeaderPane.BackColor = Color.White;
gcListBox1.ListHeaderPane.GradientEffect = gradienteffect;
gcListBox1.ListHeaderPane.Height = 20;
gcListBox1.ListHeaderPane.Visible = true;
// Sets the item style for disabled items.
gcListBox1.DisabledItemStyle.BackColor = SystemColors.Control;
gcListBox1.DisabledItemStyle.ForeColor = Color.Gray;
gcListBox1.DisabledItemStyle.GradientEffect = gradienteffect;
// Sets the selected item style.
gcListBox1.SelectedItemStyle.BackColor = SystemColors.Highlight;
gcListBox1.SelectedItemStyle.ForeColor = SystemColors.HighlightText;
// Sets the ItemTemplates.
ItemTemplate template = new ItemTemplate();
template.AutoItemHeight = false;
template.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
template.Height = 20;
template.Indent = 5;
gcListBox1.ItemTemplates.Add(template);
template = new ItemTemplate();
template.AutoItemHeight = false;
template.BackColor = Color.White;
template.Height = 20;
template.Indent = 5;
gcListBox1.ItemTemplates.Add(template);
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports System.Drawing;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcListStyles()
' Creates the GcListBox control.
Dim gcListBox1 As New GcListBox()
' Creates a GradientEffect object.
Dim gradienteffect As New GradientEffect()
gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side
gradienteffect.EndColor = Color.FromArgb(224, 224, 224)
' Sets the header panel
gcListBox1.ListHeaderPane.AutoHeight = False
gcListBox1.ListHeaderPane.BackColor = Color.White
gcListBox1.ListHeaderPane.GradientEffect = gradienteffect
gcListBox1.ListHeaderPane.Height = 20
gcListBox1.ListHeaderPane.Visible = True
' Sets the item style for disabled items.
gcListBox1.DisabledItemStyle.BackColor = SystemColors.Control
gcListBox1.DisabledItemStyle.ForeColor = Color.Gray
gcListBox1.DisabledItemStyle.GradientEffect = gradienteffect
' Sets the selected item style.
gcListBox1.SelectedItemStyle.BackColor = SystemColors.Highlight
gcListBox1.SelectedItemStyle.ForeColor = SystemColors.HighlightText
' Sets the ItemTemplates.
Dim template As New ItemTemplate()
template.AutoItemHeight = False
template.BackColor = Color.FromArgb(224, 224, 224)
template.Height = 20
template.Indent = 5
gcListBox1.ItemTemplates.Add(template)
template = New ItemTemplate()
template.AutoItemHeight = False
template.BackColor = Color.White
template.Height = 20
template.Indent = 5
gcListBox1.ItemTemplates.Add(template)
End Sub