Vnz*_*oso -1 c# picturebox acceptbutton winforms
有没有办法将图片框设置为winform的接受按钮?我试图在表单属性上设置它,但它没有显示出来。感谢您的回答。
不,aButton是 anIButtonControl而 aPictureBox不是。该Form.AcceptButton属性的类型为IButtonControl.
您可以ProcessCmdKey在 Form 上覆盖以拦截 Enter 键作为替代:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Enter)
{
// call your function instead if you want to do some processing first
Close();
return true; // return true to intercept the key press
}
return base.ProcessCmdKey(ref msg, keyData);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
902 次 |
| 最近记录: |