// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
// using System.Drawing;
public void SetAlternateTextSettings()
{
// Creates an instance of a GcTimeSpan control.
GcTimeSpan gcTimeSpan1 = new GcTimeSpan();
// Clear the default DisplayFields
gcTimeSpan1.DisplayFields.Clear();
// Sets the text of the DisplayNull property.
// The text will displayed when the GcTimeSpan control lost focus.
gcTimeSpan1.AlternateText.DisplayNull.Text = "Null";
// Sets the ForeColor of the DisplayNull property.
// The text will displayed with this color.
gcTimeSpan1.AlternateText.DisplayNull.ForeColor = Color.Gray;
// Sets the text of the Null property.
// The text will displayed when the GcTimeSpan control got focus.
gcTimeSpan1.AlternateText.Null.Text = "Please input here";
// Sets the ForeColor of the Null property.
// The text will displayed with this color.
gcTimeSpan1.AlternateText.Null.ForeColor = Color.Gray;
// Sets the DisplayZero.Text to a string for displaying when the value is zero without the input focus.
gcTimeSpan1.AlternateText.DisplayZero.Text = "Zero";
// Sets the Zero.Text to a string for displaying when the value is zero with the input focus.
gcTimeSpan1.AlternateText.Zero.Text = "Please input here";
// Defines the display fields.
gcTimeSpan1.DisplayFields.AddRange(@"h:m:s",0,'.',string.Empty,string.Empty,"-",string.Empty);
// Sets font of all literal fields.
List<TimeSpanLiteralField> literalFields = gcTimeSpan1.Fields.FindAll<TimeSpanLiteralField>();
foreach (TimeSpanLiteralField field in literalFields)
{
field.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
}
// Sets the value of the GcTimeSpan.
gcTimeSpan1.Value = TimeSpan.Parse("00:00:00");
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
' Imports System.Drawing;
Public Sub SetAlternateTextSettings()
' Creates an instance of a GcTimeSpan control.
Dim gcTimeSpan1 As New GcTimeSpan()
' Clear the default DisplayFields
gcTimeSpan1.DisplayFields.Clear()
' Sets the text of the DisplayNull property.
' The text will displayed when the GcTimeSpan control lost focus.
gcTimeSpan1.AlternateText.DisplayNull.Text = "Null"
' Sets the ForeColor of the DisplayNull property.
' The text will displayed with this color.
gcTimeSpan1.AlternateText.DisplayNull.ForeColor = Color.Gray
' Sets the text of the Null property.
' The text will displayed when the GcTimeSpan control got focus.
gcTimeSpan1.AlternateText.Null.Text = "Please input here"
' Sets the ForeColor of the Null property.
' The text will displayed with this color.
gcTimeSpan1.AlternateText.Null.ForeColor = Color.Gray
' Sets the DisplayZero.Text to a string for displaying when the value is zero without the input focus.
gcTimeSpan1.AlternateText.DisplayZero.Text = "Zero"
' Sets the Zero.Text to a string for displaying when the value is zero with the input focus.
gcTimeSpan1.AlternateText.Zero.Text = "Please input here"
' Defines the display fields.
gcTimeSpan1.DisplayFields.AddRange("h:m:s", 0, "."c, String.Empty, String.Empty, "-", _
String.Empty)
' Sets font of all literal fields.
Dim literalFields As List(Of TimeSpanLiteralField) = gcTimeSpan1.Fields.FindAll(Of TimeSpanLiteralField)()
For Each field As TimeSpanLiteralField In literalFields
field.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 134)
Next
' Sets the value of the GcTimeSpan.
gcTimeSpan1.Value = TimeSpan.Parse("00:00:00")
End Sub