Defines the background color while the contents are not valid.
Class: SftMask
Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET
public Color InvalidBackColor { get; set; }
Public Property InvalidBackColor As ColorThe color, or Color.Empty to show invalid contents like valid ones.
The default value is Color.Empty.
Defines the background color while the contents are not valid.
Validity includes the SftMask.CustomValidation event, which the control raises when the contents change while an invalid color is set.
private void checkUnderline_CheckedChanged(object sender, EventArgs e) {
foreach (SftMask field in fields)
field.PromptUnderline = checkUnderline.Checked;
}
// Fields whose contents are incomplete or out of range are shown in other colors.
private void checkInvalid_CheckedChanged(object sender, EventArgs e) {
foreach (SftMask field in fields) {
field.InvalidBackColor = checkInvalid.Checked ? Color.MistyRose : Color.Empty;
field.InvalidForeColor = checkInvalid.Checked ? Color.DarkRed : Color.Empty;
}
}
}
}
For Each field As SftMask In fields
field.PromptUnderline = CheckUnderline.Checked
Next
End Sub
' Fields whose contents are incomplete or out of range are shown in other colors.
Private Sub CheckInvalid_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckInvalid.CheckedChanged
For Each field As SftMask In fields
field.InvalidBackColor = If(CheckInvalid.Checked, Color.MistyRose, Color.Empty)
field.InvalidForeColor = If(CheckInvalid.Checked, Color.DarkRed, Color.Empty)
Next
End Sub
End ClassSee Also SftMask Class | Classes | SftMask/NET 3.0