Force DataTimePicker to open calendar by F12
- From: "Andrus" <kobruleht2@xxxxxx>
- Date: Thu, 19 Jun 2008 21:41:56 +0300
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.KeyEventArgs.KeyCode' cannot be assigned to -- it is read only
How to fix ?
Andrus.
public class NullableDateTimePicker : DateTimePicker {
protected override void OnKeyDown(KeyEventArgs e) {
base.OnKeyDown(e);
if (e.KeyCode == Keys.F12)
e.KeyCode = Keys.F4;
}
}
.
- Follow-Ups:
- Re: Force DataTimePicker to open calendar by F12
- From: Cowboy \(Gregory A. Beamer\)
- Re: Force DataTimePicker to open calendar by F12
- Prev by Date: C# Windows Service
- Next by Date: Re: Memory Leak
- Previous by thread: C# Windows Service
- Next by thread: Re: Force DataTimePicker to open calendar by F12
- Index(es):