PowerTools InputMan for Windows Forms 8.0J
DefaultColumn プロパティ
使用例 

カラムの既定値を取得または設定します。
構文
Public Property DefaultColumn As DefaultListColumn
public DefaultListColumn DefaultColumn {get; set;}
解説
このプロパティは、列の既定の設定を定義する場合に使用します。外観に変更を加えずに列を追加すると、その列は既定の列設定を使用して表示されます。
使用例
カラムスタイルの既定値を設定した GcListBox コントロールを作成するコード例を次に示します。カラムが追加された時には、既定値のスタイルが設定されます。この例では他に Columns と DefaultColumn プロパティを使用しています。
//  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
参照

GcListBox クラス
GcListBox メンバ
Columns プロパティ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.