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