I need that WinForms DateTimePicker opens calendar when F12 key is pressed.
I tried code below but got error
Property or indexer 'System.Windows .Forms.KeyEvent Args.KeyCode' cannot be
assigned to -- it is read only
How to fix ?
Andrus.
public class NullableDateTim ePicker : DateTimePicker {
protected override void OnKeyDown(KeyEv entArgs e) {
base.OnKeyDown( e);
if (e.KeyCode == Keys.F12)
e.KeyCode = Keys.F4;
}
}
I tried code below but got error
Property or indexer 'System.Windows .Forms.KeyEvent Args.KeyCode' cannot be
assigned to -- it is read only
How to fix ?
Andrus.
public class NullableDateTim ePicker : DateTimePicker {
protected override void OnKeyDown(KeyEv entArgs e) {
base.OnKeyDown( e);
if (e.KeyCode == Keys.F12)
e.KeyCode = Keys.F4;
}
}
Comment