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

スピンボタンを動作を設定するSpinオブジェクトを取得または設定します。
構文
Public ReadOnly Property Spin As Spin
public Spin Spin {get;}

プロパティ値

スピンボタンの動作を設定するSpinオブジェクト。
解説
Spin オブジェクトは、スピンボタンの動作に関する設定を行います。 スピンボタンの配置などの設定はSideButtonsコレクションに 追加したSpinButtonオブジェクトによって行います。
使用例
スピンアップ機能とスピンダウン機能を利用した GcMask コントロールを作成するコード例を次に示します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void SetSpinSettings()
{
    // Creates an instance of a GcMask control.
    GcMask gcMask1 = new GcMask();

    // Creates some fields.
    GrapeCity.Win.Editors.Fields.MaskLiteralField maskLiteralField1 = new GrapeCity.Win.Editors.Fields.MaskLiteralField();
    GrapeCity.Win.Editors.Fields.MaskLiteralField maskLiteralField2 = new GrapeCity.Win.Editors.Fields.MaskLiteralField();
    GrapeCity.Win.Editors.Fields.MaskEnumerationField maskEnumerationField1 = new GrapeCity.Win.Editors.Fields.MaskEnumerationField();

    // Sets the settings about fields.
    maskLiteralField1.Text = "Contact Us:";
    maskLiteralField2.Text = " Info@";
    maskEnumerationField1.Items = new string[] {
"GrapeCity.com",
"GrapeCity.com.cn",
"GrapeCity.com.jp"};

    // Adds fields.
    gcMask1.Fields.AddRange(new GrapeCity.Win.Editors.Fields.MaskField[] {
    maskLiteralField1,
    maskLiteralField2,
    maskEnumerationField1});

    // Sets the AllowSpin to true.
    gcMask1.Spin.AllowSpin = true;
    // Sets the Wrap to false. When the value is the maximum or minimum, it can't spin any more.
    gcMask1.Spin.Wrap = false;
    // Sets the Increment to 2, the value of the control will change 2 items.
    gcMask1.Spin.Increment = 2;
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub SetSpinSettings()
    ' Creates an instance of a GcMask control.
    Dim gcMask1 As New GcMask()

    ' Creates some fields.
    Dim maskLiteralField1 As New GrapeCity.Win.Editors.Fields.MaskLiteralField()
    Dim maskLiteralField2 As New GrapeCity.Win.Editors.Fields.MaskLiteralField()
    Dim maskEnumerationField1 As New GrapeCity.Win.Editors.Fields.MaskEnumerationField()

    ' Sets the settings about fields.
    maskLiteralField1.Text = "Contact Us:"
    maskLiteralField2.Text = " Info@"
    maskEnumerationField1.Items = New String() {"GrapeCity.com", "GrapeCity.com.cn", "GrapeCity.com.jp"}

    ' Adds fields.
    gcMask1.Fields.AddRange(New GrapeCity.Win.Editors.Fields.MaskField() {maskLiteralField1, maskLiteralField2, maskEnumerationField1})

    ' Sets the AllowSpin to true.
    gcMask1.Spin.AllowSpin = True
    ' Sets the Wrap to false. When the value is the maximum or minimum, it can't spin any more.
    gcMask1.Spin.Wrap = False
    ' Sets the Increment to 2, the value of the control will change 2 items.
    gcMask1.Spin.Increment = 2
End Sub
参照

GcMask クラス
GcMask メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.