I changed the DateTimePicker template using MaskedTextBox and it does not work properly. The position of the caret is changed when I try to enter a date.
How can I fix this?
Comments: ** Comment from web user: BoucherS **
How can I fix this?
Comments: ** Comment from web user: BoucherS **
Hi,
This will be fixed in v3.2.
In the meantime, you can go in file Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs,
in method PerformMouseSelection(),
and replace its content with ;
```
var dateTimeInfo = this.GetDateTimeInfo( TextBox.SelectionStart );
if( (dateTimeInfo != null) && (dateTimeInfo.Type == DateTimePart.Other) )
{
this.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action( () =>
{
// Select the next dateTime part
this.Select( this.GetDateTimeInfo( dateTimeInfo.StartPosition + dateTimeInfo.Length ) );
}
) );
return;
}
this.Select( dateTimeInfo );
```