' Please use the following namespace
' Imports System.Windows.Forms;
' Imports System.Drawing;
' Imports GrapeCity.Win.Editors;
Public Sub SetListColumns()
' Creates the GcMaskedComboBox
Dim gcMaskedComboBox1 As New GcMaskedComboBox()
' Sets the DefaultListItem settings.
gcMaskedComboBox1.ListDefaultColumn.AutoWidth = True
gcMaskedComboBox1.ListDefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter
' Creates a GradientEffect object.
Dim gradienteffect As New GradientEffect()
gradienteffect.Direction = GradientDirection.Side
gradienteffect.EndColor = Color.FromArgb(224, 224, 224)
gcMaskedComboBox1.ListDefaultColumn.Header.GradientEffect = gradienteffect
gcMaskedComboBox1.ListDefaultColumn.Header.TextEffect = TextEffect.RaisedLite
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.Padding = New Padding(2, 2, 2, 2)
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.WordWrap = False
' The column1 and the column2 inherits the settings of the DefaultListColumn
Dim column1 As New ListColumn()
Dim column2 As New ListColumn()
' The column3 overwrites some properties for advanced settings.
Dim column3 As New ListColumn()
column3.AutoWidth = False
column3.DataDisplayType = DataDisplayType.Image
column3.Header.AllowResize = True
column3.Header.Clickable = True
column3.Header.Image = New Bitmap("C:\ColumnHeader.jpg")
column3.Header.TextAttachAlignment = AttachAlignment.RightMiddle
gcMaskedComboBox1.ListColumns.AddRange(New ListColumn() {column1, column2, column3})
End Sub
// Please use the following namespace
// using System.Windows.Forms;
// using System.Drawing;
// using GrapeCity.Win.Editors;
public void SetListColumns()
{
// Creates the GcMaskedComboBox
GcMaskedComboBox gcMaskedComboBox1 = new GcMaskedComboBox();
// Sets the DefaultListItem settings.
gcMaskedComboBox1.ListDefaultColumn.AutoWidth = true;
gcMaskedComboBox1.ListDefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter;
// Creates a GradientEffect object.
GradientEffect gradienteffect = new GradientEffect();
gradienteffect.Direction = GradientDirection.Side;
gradienteffect.EndColor = Color.FromArgb(224, 224, 224);
gcMaskedComboBox1.ListDefaultColumn.Header.GradientEffect = gradienteffect;
gcMaskedComboBox1.ListDefaultColumn.Header.TextEffect = TextEffect.RaisedLite;
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter;
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.Padding = new Padding(2, 2, 2, 2);
gcMaskedComboBox1.ListDefaultColumn.DefaultSubItem.WordWrap = false;
// The column1 and the column2 inherits the settings of the DefaultListColumn
ListColumn column1 = new ListColumn();
ListColumn column2 = new ListColumn();
// The column3 overwrites some properties for advanced settings.
ListColumn column3 = new ListColumn();
column3.AutoWidth = false;
column3.DataDisplayType = DataDisplayType.Image;
column3.Header.AllowResize = true;
column3.Header.Clickable = true;
column3.Header.Image = new Bitmap(@"C:\ColumnHeader.jpg");
column3.Header.TextAttachAlignment = AttachAlignment.RightMiddle;
gcMaskedComboBox1.ListColumns.AddRange(new ListColumn[] { column1, column2, column3 });
}