Posted 10 May 2021, 3:52 am EST
Is there a way to stop the user being able to manually edit a date but instead are forced to use the calendar drop-down only?
Thanks - John
Forums Home / ComponentOne / WinForms Edition
Posted by: jxbhome on 10 May 2021, 3:52 am EST
Posted 10 May 2021, 3:52 am EST
Is there a way to stop the user being able to manually edit a date but instead are forced to use the calendar drop-down only?
Thanks - John
Posted 10 May 2021, 8:34 pm EST
Hello John,
You can handle the KeyDown event of C1DateEdit and set the SuppressKeyPress property of the KeyEventArgs to true to stop the editing via Keyboard.
c1DateEdit1.KeyDown += C1DateEdit1_KeyDown;
private void C1DateEdit1_KeyDown(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;
}
Regards,
Prabhat Sharma.