Есть родительское главное окно(IsMDIContainer = true) с меню. из меню вызывается форма (MdiChildren). Когда форма(MdiChildren) активная, нажимаем функциональные кнопки (F4, F12, F10, F9), нужно отловить эти нажатия.
события формы не работают.(во всяком случае под отладчиком я туда не попадаю)
private void frmRunnerDataEntry_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
int i = e.KeyChar;
}
private void frmRunnerDataEntry_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
int i = e.KeyValue;
}
private void frmRunnerDataEntry_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
int i = e.KeyValue;
}
Может кто другое решение знает.
что то вроде:
To create an access key for a control programmatically
Set the Text property to a string that includes an ampersand before the letter that will be the shortcut.
// C#
// Set the letter "P" as an access key.
button1.Text = "&Print";
только без Alt + , а (кнопка А4)
13.07.06 20:31: Перенесено модератором из '.NET' — IT