Programming/C/C++/C#
[Visual Studio] Main Form에서 단축키 만들기
stluck
2011. 6. 1. 10:59
void InitializeComponent(void) {
this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::Form1_KeyDown);
}
private: void Form1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e)
{
if (e->Control && e->KeyCode == System::Windows::Forms::Keys::D)
{
MessageBox::Show(this,"KeyPreview is True, and this came from the FORM");
}
}
MessageBox::Show(this,"KeyPreview is True, and this came from the FORM");
}
}