// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
// using System.Drawing;
public void SetAlternateTextSettings()
{
// Creates an instance of a GcNumber control.
GcNumber gcNumber1 = new GcNumber();
// Clear the default DisplayFields
gcNumber1.DisplayFields.Clear();
// Sets the text of the DisplayNull property.
// The text will displayed when the GcNumber control lost focus.
gcNumber1.AlternateText.DisplayNull.Text = "Null";
// Sets the ForeColor of the DisplayNull property.
// The text will displayed with this color.
gcNumber1.AlternateText.DisplayNull.ForeColor = Color.Gray;
// Sets the text of the Null property.
// The text will displayed when the GcNumber control got focus.
gcNumber1.AlternateText.Null.Text = "Please input a number.";
// Sets the ForeColor of the Null property.
// The text will displayed with this color.
gcNumber1.AlternateText.Null.ForeColor = Color.Gray;
// Sets the DisplayZero.Text to a string for displaying when the value is zero without the input focus.
gcNumber1.AlternateText.DisplayZero.Text = "Zero";
// Sets the Zero.Text to a string for displaying when the value is zero with the input focus.
gcNumber1.AlternateText.Zero.Text = "Please input a number.";
// Customize the fields.
gcNumber1.Fields.SetFields("###,###,###0.00", "+", "", "-", "");
// Defines the display fields.
NumberSignDisplayField numberSignDisplayField1 = new NumberSignDisplayField();
NumberIntegerPartDisplayField numberIntegerPartDisplayField1 = new NumberIntegerPartDisplayField();
numberIntegerPartDisplayField1.GroupSizes = new int[] {0};
numberIntegerPartDisplayField1.MinDigits = 9;
gcNumber1.DisplayFields.AddRange(new NumberDisplayField[] {
numberSignDisplayField1,
numberIntegerPartDisplayField1});
// Sets the value of the GcNumber for displaying the AlternateText.Zero.Text abd AlternateText.DisplayZero.Text.
gcNumber1.Value = 0;
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
' Imports System.Drawing;
Public Sub SetAlternateTextSettings()
' Creates an instance of a GcNumber control.
Dim gcNumber1 As New GcNumber()
' Clear the default DisplayFields
gcNumber1.DisplayFields.Clear()
' Sets the text of the DisplayNull property.
' The text will displayed when the GcNumber control lost focus.
gcNumber1.AlternateText.DisplayNull.Text = "Null"
' Sets the ForeColor of the DisplayNull property.
' The text will displayed with this color.
gcNumber1.AlternateText.DisplayNull.ForeColor = Color.Gray
' Sets the text of the Null property.
' The text will displayed when the GcNumber control got focus.
gcNumber1.AlternateText.Null.Text = "Please input a number."
' Sets the ForeColor of the Null property.
' The text will displayed with this color.
gcNumber1.AlternateText.Null.ForeColor = Color.Gray
' Sets the DisplayZero.Text to a string for displaying when the value is zero without the input focus.
gcNumber1.AlternateText.DisplayZero.Text = "Zero"
' Sets the Zero.Text to a string for displaying when the value is zero with the input focus.
gcNumber1.AlternateText.Zero.Text = "Please input a number."
' Customize the fields.
gcNumber1.Fields.SetFields("###,###,###0.00", "+", "", "-", "")
' Defines the display fields.
Dim numberSignDisplayField1 As New NumberSignDisplayField()
Dim numberIntegerPartDisplayField1 As New NumberIntegerPartDisplayField()
numberIntegerPartDisplayField1.GroupSizes = New Integer() {0}
numberIntegerPartDisplayField1.MinDigits = 9
gcNumber1.DisplayFields.AddRange(New NumberDisplayField() {numberSignDisplayField1, numberIntegerPartDisplayField1})
' Sets the value of the GcNumber for displaying the AlternateText.Zero.Text abd AlternateText.DisplayZero.Text.
gcNumber1.Value = 0
End Sub