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