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

項目のテンプレートを示すItemTemplateCollection値を取得または設定します。
構文
Public Property ListItemTemplates As ItemTemplateCollection
public ItemTemplateCollection ListItemTemplates {get; set;}

プロパティ値

ItemTemplateCollection値。
解説
このプロパティは、リスト項目の既定の設定を定義する場合に使用します。外観に変更を加えずに項目を追加すると、その項目はテンプレート設定を使用して表示されます。
使用例
ヘッダと項目のスタイルを設定したGcMaskedComboBoxコントロールを作成するコード例を次に示します。この例では他にListHeaderPaneListDisabledItemStyleListSelectedItemStyleListItemTemplatesプロパティを使用しています。
'  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);
}
参照

GcMaskedComboBox クラス
GcMaskedComboBox メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.