// Please use the following namespace
// using System.Windows.Forms;
// using System.Drawing;
// using GrapeCity.Win.Editors;
public void SetColumns()
{
// Creates the GcListBox
GcListBox gcListBox1 = new GcListBox();
gcListBox1.DefaultColumn.AutoWidth = true;
gcListBox1.DefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter;
// Creates a GradientEffect object.
GradientEffect gradienteffect = new GradientEffect();
gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side;
gradienteffect.EndColor = Color.FromArgb(224, 224, 224);
gcListBox1.DefaultColumn.Header.GradientEffect = gradienteffect;
gcListBox1.DefaultColumn.Header.TextEffect = TextEffect.RaisedLite;
gcListBox1.DefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter;
gcListBox1.DefaultColumn.DefaultSubItem.Padding = new Padding(2, 2, 2, 2);
gcListBox1.DefaultColumn.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;
gcListBox1.Columns.AddRange(new ListColumn[] {column1,column2,column3 });
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports System.Drawing;
' Imports GrapeCity.Win.Editors;
Public Sub SetColumns()
' Creates the GcListBox
Dim gcListBox1 As New GcListBox()
gcListBox1.DefaultColumn.AutoWidth = True
gcListBox1.DefaultColumn.Header.ContentAlignment = ContentAlignment.MiddleCenter
' Creates a GradientEffect object.
Dim gradienteffect As New GradientEffect()
gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side
gradienteffect.EndColor = Color.FromArgb(224, 224, 224)
gcListBox1.DefaultColumn.Header.GradientEffect = gradienteffect
gcListBox1.DefaultColumn.Header.TextEffect = TextEffect.RaisedLite
gcListBox1.DefaultColumn.DefaultSubItem.ContentAlignment = ContentAlignment.MiddleCenter
gcListBox1.DefaultColumn.DefaultSubItem.Padding = New Padding(2, 2, 2, 2)
gcListBox1.DefaultColumn.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
gcListBox1.Columns.AddRange(New ListColumn() {column1, column2, column3})
End Sub