Events in Windows Forms DateTimePickerAdv(Classic)

26 Apr 20211 minute to read

Following are the events of DateTimePickerAdv control.

PopupClosed Event

The PopupClosed event is handled when the popup is closed. Using the PopupCloseType member of the PopupClosedEventHandler, we can identify the type of closing.

private void dateTimePickerAdv1_PopupClosed(object sender, PopupClosedEventArgs e)
{            
    //Canceled - User cancels the updates if any.
    //Deactivated - If the user moves the focus to some other window
    //Done - If the user wants the changes to be applied to the control
    Console.WriteLine(e.PopupCloseType.ToString());
}
Private Sub dateTimePickerAdv1_PopupClosed(ByVal sender As Object, ByVal e As PopupClosedEventArgs)
    'Canceled - User cancels the updates if any. 
    'Deactivated - If the user moves the focus to some other window 
    'Done - If the user wants the changes to be applied to the control 
    Console.WriteLine(e.PopupCloseType.ToString())
End Sub