CheckBox控件,只允许鼠标单击,想进制按空格键切换打勾状态!
在窗体上放ApplicationEvents控件,消息截获处理!
void __fastcall TForm19::ApplicationEvents1Message(tagMSG &Msg, bool &Handled)
{
if (Msg.message == WM_KEYDOWN && Msg.hwnd == this->CheckBox1->Handle)
{
Handled = true;
}
}