Windows应用程序中的按钮问题 [英] Problem with button in windows application

查看:93
本文介绍了Windows应用程序中的按钮问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我对按钮有一个小问题.?我设计了一个表单并只放置了一个按钮.执行该表单时,如果我按空格键并自动输入按钮,则按钮功能正在执行.必须工作.您能否尽快回复wt.



谢谢与问候,
Sandeep

Hi guys,
I have a small problem with button.?I have designed one form and placed only one button.When executing that form if i press space bar and enter key automatically that button functions are executing.What i want is when i click on button only it has to work.So can u plese reply wt to do as possible as early.



Thanks&Regards,
Sandeep

推荐答案

因为它现在是表单上的唯一控件,因此它会自动升级为默认控件.只需将制表位设置为false即可,只有用鼠标单击才能使其生效.考虑到可访问性,这并不是很好的做法.

祝你好运!
Because it is now the only control on your form it is automatically promoted as the default control. Simply set tab stop to false and only a click with the mouse will get it into action. Considering accessibility this isn''t very good practice though.

Good luck!




使用MouseClick事件而不是Click事件.

Hi,

Use MouseClick Event instead of Click Event.

private void button1_MouseClick(object sender, MouseEventArgs e)



问候
Ankit



Regards
Ankit


这篇关于Windows应用程序中的按钮问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆