PowerTools InputMan for Windows Forms 8.0J
DoSpinUp() メソッド
使用例 

スピンアップ動作を実行します。
構文
Public Overloads Sub DoSpinUp() 
public void DoSpinUp()
解説
このメソッドを呼び出すことは、コントロールにフォーカスがあるときに[↑]キーを押すことと同じです。
使用例
サイドボタンと入力フィールドを設定した GcComboBox コントロールを作成するコード例を次に示します。サイドボタンクリック時にコントロールの値が変化します。この例では他に SideButtons プロパティと DoSpinUp や DoSpinDown メソッドを使用しています。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;
//  using Fields;

// Creates an instance of a GcComboBox control.
GcComboBox gcComboBox1 = new GcComboBox();
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.
    gcComboBox1.SideButtons.AddRange(new SideButtonBase[] {
    symbolButton1,
    symbolButton2});
}

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

private void OnSymbolButton1Click(object sender, EventArgs e)
{
    // Spin the GcComboBox value to the greater one.
    gcComboBox1.DoSpinUp();
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;
'  Imports Fields;

' Creates an instance of a GcComboBox control.
Private gcComboBox1 As New GcComboBox()
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.
    gcComboBox1.SideButtons.AddRange(New SideButtonBase() {symbolButton1, symbolButton2})
End Sub

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

Private Sub OnSymbolButton1Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Spin the GcComboBox value to the greater one.
    gcComboBox1.DoSpinUp()
End Sub
参照

GcComboBox クラス
GcComboBox メンバ
オーバーロード一覧
DoSpinDown メソッド

 

 


© 2004-2015 GrapeCity inc. All rights reserved.