Defines the value of the first numeric field of the mask.
Class: SftMask
Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET
public decimal? Value { get; set; }
Public Property Value As Decimal?The value, or null when the mask has no numeric field or the field is empty.
Defines the value of the first numeric field of the mask.
Setting a value throws an InvalidOperationException when the mask has no numeric field, and an ArgumentOutOfRangeException when the value is outside the range or the digits of the field. Fraction digits beyond those of the field are rounded; null empties the field.
InitializeComponent();
fields = new SftMask[] { sftMaskPhone, sftMaskZip, sftMaskAmount, sftMaskPercent, sftMaskQuantity, sftMaskIP,
sftMaskColor, sftMaskKey, sftMaskPin, sftMaskCity, sftMaskFile };
sftMaskPhone.Text = "4079045200";
sftMaskZip.Text = "328011234";
sftMaskIP.Text = "192168001001";
// Numbers are set as values, so they do not depend on the culture's separators.
sftMaskAmount.Value = 1234.5m;
sftMaskPercent.Value = 25;
sftMaskQuantity.Value = 10;
sftMaskColor.Value = 0x2E8B57;
// The city field suggests earlier entries, starting with a few cities.
sftMaskCity.AutoComplete.Seed(new string[] { "Orlando", "Ocala", "Ocoee", "Oviedo", "Orange City", "Miami", "Tampa", "Tallahassee" });
InitializeComponent()
fields = New SftMask() {SftMaskPhone, SftMaskZip, SftMaskAmount, SftMaskPercent, SftMaskQuantity, SftMaskIP,
SftMaskColor, SftMaskKey, SftMaskPin, SftMaskCity, SftMaskFile}
SftMaskPhone.Text = "4079045200"
SftMaskZip.Text = "328011234"
SftMaskIP.Text = "192168001001"
' Numbers are set as values, so they do not depend on the culture's separators.
SftMaskAmount.Value = 1234.5D
SftMaskPercent.Value = 25
SftMaskQuantity.Value = 10
SftMaskColor.Value = &H2E8B57
' The city field suggests earlier entries, starting with a few cities.
SftMaskCity.AutoComplete.Seed(New String() {"Orlando", "Ocala", "Ocoee", "Oviedo", "Orange City", "Miami", "Tampa", "Tallahassee"})
See Also SftMask Class | Classes | SftMask/NET 3.0