// 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