View Full Version : 确定


Kylin
04-06-2007, 07:28 AM
如何使确认button和键盘的enter健相关联

t-xguo@prcvap.microsoft.com
04-06-2007, 11:13 AM
:
ԴButtonڴڵKeyPress¼,Ȼڸ¼дButtonclick¼.ʾ:

private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\n')
{
this.button1.PerformClick();
}
}


߼ֹ֧ʦ
΢ȫ֧
---------------------------------------------------------------------------------------
ǵķʱ䣺һ9:00-18:00ڼճ⣩ǽգ48СʱṩʼӦһо⡣΢鼼֧Ϣʣhttp://support.microsoft.com/gp/newsgroupsupport/zh-cn.

ʱĶʹáظ(Reply to Group)⽫ûл
---------------------------------------------------------------------------------------
ԡ״ṩûκεͬʱҲûκȨ

秦风意动
04-08-2007, 07:56 AM
记得vs6.0时有
控件有默认的Enter和Esc键的属性

..net 不知道还有不?
用form_keypress的话 可能需要选上 响应所有的子控件的keypress

“t-xguo@prcvap.microsoft.com”编写:

> 您好:
> 可以处理Button所在窗口的KeyPress事件,然后在该事件处理函数中触发Button的click事件.示例代码如下:
>
> private void Form1_KeyPress(object sender, KeyPressEventArgs e)
> {
> if (e.KeyChar == '\n')
> {
> this.button1.PerformClick();
> }
> }
>
> 郭轩
> 在线技术支持工程师
> 微软全球技术支持中心
> ---------------------------------------------------------------------------------------
> 我们的服务时间:周一至周五9:00-18:00(节假日除外)。我们将在两个工作日(48小时)内提供初始回应,并和您一起研究并解决问题。更多微软新闻组技术支持信息,请访问:http://support.microsoft.com/gp/newsgroupsupport/zh-cn.
>
> 回帖时,请在您的新闻组阅读器中使用“回复组(Reply to Group)”,这将帮助其他用户从您的提问中获益
> ---------------------------------------------------------------------------------------
> 本贴子以”现状”提供且没有任何担保,同时也没有授予任何权利。

t-xguo@prcvap.microsoft.com
04-09-2007, 03:13 AM
ã

ڴ壬Ƿʣκʣӭ΢ۡ


߼ֹ֧ʦ
΢ȫ֧
---------------------------------------------------------------------------------------
ǵķʱ䣺һ9:00-18:00ڼճ⣩ǽգ48СʱṩʼӦһо⡣΢鼼֧Ϣʣhttp://support.microsoft.com/gp/newsgroupsupport/zh-cn.

ʱĶʹáظ(Reply to Group)⽫ûл
---------------------------------------------------------------------------------------
ԡ״ṩûκεͬʱҲûκȨ