PowerTools InputMan for Windows Forms 8.0J
ListHeaderPane プロパティ (GcListBox)
使用例 

リストヘッダ部のスタイルを取得または設定します。
構文
Public ReadOnly Property ListHeaderPane As ListHeaderPane
public ListHeaderPane ListHeaderPane {get;}

プロパティ値

リストヘッダ部のスタイルを表すListHeaderPaneオブジェクト。
解説
このプロパティは、このコントロールのヘッダパネルの外観を決定します。
使用例
ヘッダと項目のスタイルを設定した GcListBox コントロールを作成するコード例を次に示します。この例では他に ListHeaderPane、DisabledItemStyleSelectedItemStyleItemTemplates プロパティを使用しています。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using System.Drawing;
//  using GrapeCity.Win.Editors;

public void SetGcListStyles()
{
    // Creates the GcListBox control.
    GcListBox gcListBox1 = new GcListBox();

    // Creates a GradientEffect object.
    GradientEffect gradienteffect = new GradientEffect();
    gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side;
    gradienteffect.EndColor = Color.FromArgb(224, 224, 224);

    // Sets the header panel
    gcListBox1.ListHeaderPane.AutoHeight = false;
    gcListBox1.ListHeaderPane.BackColor = Color.White;
    gcListBox1.ListHeaderPane.GradientEffect = gradienteffect;
    gcListBox1.ListHeaderPane.Height = 20;
    gcListBox1.ListHeaderPane.Visible = true;

    // Sets the item style for disabled items.
    gcListBox1.DisabledItemStyle.BackColor = SystemColors.Control;
    gcListBox1.DisabledItemStyle.ForeColor = Color.Gray;
    gcListBox1.DisabledItemStyle.GradientEffect = gradienteffect;

    // Sets the selected item style.
    gcListBox1.SelectedItemStyle.BackColor = SystemColors.Highlight;
    gcListBox1.SelectedItemStyle.ForeColor = SystemColors.HighlightText;

    // Sets the ItemTemplates.
    ItemTemplate template = new ItemTemplate();
    template.AutoItemHeight = false;
    template.BackColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
    template.Height = 20;
    template.Indent = 5;
    gcListBox1.ItemTemplates.Add(template);
    template = new ItemTemplate();
    template.AutoItemHeight = false;
    template.BackColor = Color.White;
    template.Height = 20;
    template.Indent = 5;
    gcListBox1.ItemTemplates.Add(template);
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports System.Drawing;
'  Imports GrapeCity.Win.Editors;

Public Sub SetGcListStyles()
    ' Creates the GcListBox control.
    Dim gcListBox1 As New GcListBox()

    ' Creates a GradientEffect object.
    Dim gradienteffect As New GradientEffect()
    gradienteffect.Direction = GrapeCity.Win.Editors.GradientDirection.Side
    gradienteffect.EndColor = Color.FromArgb(224, 224, 224)

    ' Sets the header panel
    gcListBox1.ListHeaderPane.AutoHeight = False
    gcListBox1.ListHeaderPane.BackColor = Color.White
    gcListBox1.ListHeaderPane.GradientEffect = gradienteffect
    gcListBox1.ListHeaderPane.Height = 20
    gcListBox1.ListHeaderPane.Visible = True

    ' Sets the item style for disabled items.
    gcListBox1.DisabledItemStyle.BackColor = SystemColors.Control
    gcListBox1.DisabledItemStyle.ForeColor = Color.Gray
    gcListBox1.DisabledItemStyle.GradientEffect = gradienteffect

    ' Sets the selected item style.
    gcListBox1.SelectedItemStyle.BackColor = SystemColors.Highlight
    gcListBox1.SelectedItemStyle.ForeColor = SystemColors.HighlightText

    ' Sets the ItemTemplates.
    Dim template As New ItemTemplate()
    template.AutoItemHeight = False
    template.BackColor = Color.FromArgb(224, 224, 224)
    template.Height = 20
    template.Indent = 5
    gcListBox1.ItemTemplates.Add(template)
    template = New ItemTemplate()
    template.AutoItemHeight = False
    template.BackColor = Color.White
    template.Height = 20
    template.Indent = 5
    gcListBox1.ItemTemplates.Add(template)
End Sub
参照

GcListBox クラス
GcListBox メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.