Provides data for the SftDate.ValueValidating event, raised before a value entered by the user is accepted.
An event handler can change the new value or cancel the change, which restores the previous value.
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET
Inheritance
public class ValueValidatingEventArgs : System.ComponentModel.CancelEventArgs;
Public Class ValueValidatingEventArgs
Inherits System.ComponentModel.CancelEventArgsThis class cannot be instantiated.
![]() ![]() | Cancel | Gets or sets a value indicating whether the event should be canceled. |
![]() | NewRangeEnd | Defines the new last date of a range. |
![]() | NewValue | Defines the new value, or null for an empty field. |
![]() ![]() ![]() | Empty | Provides a value to use with events that do not have event data. |
![]() ![]() | Equals | Determines whether the specified object is equal to the current object. |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. |
![]() ![]() | GetHashCode | Serves as the default hash function. |
![]() ![]() | GetType | Gets the Type of the current instance. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. |
![]() ![]() ![]() | ReferenceEquals | Determines whether the specified Object instances are the same instance. |
![]() ![]() | ToString | Returns a string that represents the current object. |
private void buttonClear_Click(object sender, EventArgs e) {
listView1.Items.Clear();
strLastEvent = "";
fLastEventDup = false;
}
// sftDate1 - a date and time field; appointments are only accepted on weekdays
private void sftDate1_ValueValidating(object sender, ValueValidatingEventArgs e) {
if (e.NewValue.HasValue && (e.NewValue.Value.DayOfWeek == DayOfWeek.Saturday || e.NewValue.Value.DayOfWeek == DayOfWeek.Sunday)) {
e.Cancel = true;
DumpValues("sftDate1.ValueValidating (canceled, a weekend)", e);
} else
DumpValues("sftDate1.ValueValidating", e);
}
Private Sub ButtonClear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonClear.Click
ListView1.Items.Clear()
strLastEvent = ""
fLastEventDup = False
End Sub
' SftDate1 - a date and time field; appointments are only accepted on weekdays
Private Sub SftDate1_ValueValidating(ByVal sender As Object, ByVal e As ValueValidatingEventArgs) Handles SftDate1.ValueValidating
If e.NewValue.HasValue AndAlso (e.NewValue.Value.DayOfWeek = DayOfWeek.Saturday OrElse e.NewValue.Value.DayOfWeek = DayOfWeek.Sunday) Then
e.Cancel = True
DumpValues("SftDate1.ValueValidating (canceled, a weekend)", e)
Else
DumpValues("SftDate1.ValueValidating", e)
End If
End SubSee Also Classes | SftDate/NET 3.0