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

コントロールに設定されているサイドボタンのコレクションを取得します。
構文
Public ReadOnly Property SideButtons As SideButtonCollection
public SideButtonCollection SideButtons {get;}

プロパティ値

サイドボタンのコレクションを表すSideButtonCollection
解説
SideButtonsにはいくつかのコマンドボタンを追加または削除できます。これには、DropDownButtonSpinButtonSideButton、およびSymbolButtonが含まれます。
使用例
サイドボタンを設定したGcMaskedComboBoxコントロールを作成するコード例を次に示します。
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;
'  Imports Fields;

' Creates an instance of a GcMaskedComboBox control.
Private gcMaskedComboBox1 As New GcMaskedComboBox()
Public Sub SetSideButtons()
    ' Defines SymbolButtons.
    Dim symbolButton1 As New SymbolButton()
    Dim symbolButton2 As New SymbolButton()
    symbolButton1.Name = "symbolButton1"
    symbolButton1.Position = ButtonPosition.LeftOutside
    symbolButton1.Symbol = Symbols.Arrow
    symbolButton1.SymbolDirection = SymbolDirection.Up
    symbolButton1.UseVisualStyleBackColor = True
    AddHandler symbolButton1.Click, AddressOf OnSymbolButton1Click
    symbolButton2.Name = "symbolButton2"
    symbolButton2.Position = ButtonPosition.RightOutside
    symbolButton2.Symbol = Symbols.Arrow
    symbolButton2.SymbolDirection = SymbolDirection.Down
    AddHandler symbolButton2.Click, AddressOf OnSymbolButton2Click

    ' Adds SymbolButtons to the SideButtons collection.
    gcMaskedComboBox1.SideButtons.AddRange(New SideButtonBase() {symbolButton1, symbolButton2})
End Sub

Private Sub OnSymbolButton2Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Spin the GcMaskedComboBox value to the less one.
    gcMaskedComboBox1.DoSpinDown()
End Sub

Private Sub OnSymbolButton1Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Spin the GcMaskedComboBox value to the greater one.
    gcMaskedComboBox1.DoSpinUp()
End Sub
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;
//  using Fields;

// Creates an instance of a GcMaskedComboBox control.
GcMaskedComboBox gcMaskedComboBox1 = new GcMaskedComboBox();
public void SetSideButtons()
{
    // Defines SymbolButtons.
    SymbolButton symbolButton1 = new SymbolButton();
    SymbolButton symbolButton2 = new SymbolButton();
    symbolButton1.Name = "symbolButton1";
    symbolButton1.Position = ButtonPosition.LeftOutside;
    symbolButton1.Symbol = Symbols.Arrow;
    symbolButton1.SymbolDirection = SymbolDirection.Up;
    symbolButton1.UseVisualStyleBackColor = true;
    symbolButton1.Click += new EventHandler(OnSymbolButton1Click);
    symbolButton2.Name = "symbolButton2";
    symbolButton2.Position = ButtonPosition.RightOutside;
    symbolButton2.Symbol = Symbols.Arrow;
    symbolButton2.SymbolDirection = SymbolDirection.Down;
    symbolButton2.Click += new EventHandler(OnSymbolButton2Click);

    // Adds SymbolButtons to the SideButtons collection.
    gcMaskedComboBox1.SideButtons.AddRange(new SideButtonBase[] {
    symbolButton1,
    symbolButton2});
}

private void OnSymbolButton2Click(object sender, EventArgs e)
{
    // Spin the GcMaskedComboBox value to the less one.
    gcMaskedComboBox1.DoSpinDown();
}

private void OnSymbolButton1Click(object sender, EventArgs e)
{
    // Spin the GcMaskedComboBox value to the greater one.
    gcMaskedComboBox1.DoSpinUp();
}
参照

GcMaskedComboBox クラス
GcMaskedComboBox メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.