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

値の増加量を表すDecimal値。
スピン機能を使って値を増加します。
構文
Public Overloads Sub DoSpinUp( _
   ByVal increment As Decimal _
) 
public void DoSpinUp( 
   decimal increment
)

パラメータ

increment
値の増加量を表すDecimal値。
解説
このメソッドの動作は、[↑]キーを押したときの動作と同じです。
使用例
サイドボタンと入力フィールドを設定した GcNumber コントロールを作成するコード例を次に示します。サイドボタンクリック時にコントロールの値が変化します。この例では他に SideButtonsFields プロパティと DoSpinUp や DoSpinDown(Decimal) メソッドを使用しています。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;
//  using GrapeCity.Win.Editors.Fields;

// Creates an instance of a GcNumber control.
GcNumber gcNumber1 = new GcNumber();
public void InitializeGcNumber()
{
    // Sets the Felds property.
    gcNumber1.Fields.DecimalPart.MaxDigits = 2;
    gcNumber1.Fields.DecimalPart.MinDigits = 2;
    gcNumber1.Fields.IntegerPart.GroupSizes = new int[] {3,3,0};
    gcNumber1.Fields.IntegerPart.MaxDigits = 9;
    gcNumber1.Fields.IntegerPart.MinDigits = 1;

    // Defines SymbolButtons.
    SymbolButton symbolButton1 = new GrapeCity.Win.Editors.SymbolButton();
    SymbolButton symbolButton2 = new GrapeCity.Win.Editors.SymbolButton();
    symbolButton1.Name = "symbolButton1";
    symbolButton1.Position = GrapeCity.Win.Editors.ButtonPosition.LeftOutside;
    symbolButton1.Symbol = GrapeCity.Win.Editors.Symbols.Arrow;
    symbolButton1.SymbolDirection = GrapeCity.Win.Editors.SymbolDirection.Up;
    symbolButton1.UseVisualStyleBackColor = true;
    symbolButton1.Click += new EventHandler(OnSymbolButton1Click);
    symbolButton2.Name = "symbolButton2";
    symbolButton2.Position = GrapeCity.Win.Editors.ButtonPosition.RightOutside;
    symbolButton2.Symbol = GrapeCity.Win.Editors.Symbols.Arrow;
    symbolButton2.SymbolDirection = GrapeCity.Win.Editors.SymbolDirection.Down;
    symbolButton2.Click += new EventHandler(OnSymbolButton2Click);

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

private void OnSymbolButton2Click(object sender, EventArgs e)
{
    // Spin the GcNumber value to the less one.
    gcNumber1.DoSpinDown(1m);
}

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

' Creates an instance of a GcNumber control.
Private gcNumber1 As New GcNumber()
Public Sub InitializeGcNumber()
    ' Sets the Felds property.
    gcNumber1.Fields.DecimalPart.MaxDigits = 2
    gcNumber1.Fields.DecimalPart.MinDigits = 2
    gcNumber1.Fields.IntegerPart.GroupSizes = New Integer() {3, 3, 0}
    gcNumber1.Fields.IntegerPart.MaxDigits = 9
    gcNumber1.Fields.IntegerPart.MinDigits = 1

    ' Defines SymbolButtons.
    Dim symbolButton1 As SymbolButton = New GrapeCity.Win.Editors.SymbolButton()
    Dim symbolButton2 As SymbolButton = New GrapeCity.Win.Editors.SymbolButton()
    symbolButton1.Name = "symbolButton1"
    symbolButton1.Position = GrapeCity.Win.Editors.ButtonPosition.LeftOutside
    symbolButton1.Symbol = GrapeCity.Win.Editors.Symbols.Arrow
    symbolButton1.SymbolDirection = GrapeCity.Win.Editors.SymbolDirection.Up
    symbolButton1.UseVisualStyleBackColor = True
    AddHandler symbolButton1.Click, AddressOf OnSymbolButton1Click
    symbolButton2.Name = "symbolButton2"
    symbolButton2.Position = GrapeCity.Win.Editors.ButtonPosition.RightOutside
    symbolButton2.Symbol = GrapeCity.Win.Editors.Symbols.Arrow
    symbolButton2.SymbolDirection = GrapeCity.Win.Editors.SymbolDirection.Down
    AddHandler symbolButton2.Click, AddressOf OnSymbolButton2Click

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

Private Sub OnSymbolButton2Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Spin the GcNumber value to the less one.
    gcNumber1.DoSpinDown(1D)
End Sub

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

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

 

 


© 2004-2015 GrapeCity inc. All rights reserved.