Hi,
I have built a WPF-UserControl that is to accept a date value. For the control is equipped with 3 TextBoxes. For day, month and year.
When the user enters a number for the day, the entered value is checked for logical validity about the event "TextBox_PreviewLostKeyboardFocus". (Only not > 31).
If the value is valid, then the focus is automatically shifted to the TextBox for the month. Is the value not valid, then forwarding the focus will be canceled and selects the specified value. The same procedure for the month (only not > 12). After entering the value for Year, the Inputs are checked for Leapyear (February 29, 2000 = o.k, 2001 = wrong). The user must Change the input.
If the control is left by the user, then about the event "Control_PreviewLostKeyboardFocus" the inputs are checked for a valid date. Are all TextBoxes empty, this ist o.k. too. This case must be checked by the application which uses my UserControl.
And now the Problem:
The event "Control_PreviewLostKeyboardFocus" is raised first by any TextBoxFocus change.
Is it possible to manipulate the raising of "Control_PreviewLostKeyboardFocus"? Or is there an other way to check the Input?
Thanks in advance.