码迷,mamicode.com
首页 > 其他好文 > 详细

this.AcceptButton = button1的用法:

时间:2015-11-18 00:44:00      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:

 1 using System;
 2 using System.Collections.Generic;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Text;
 7 using System.Windows.Forms;
 8 
 9 namespace Test02
10 {
11     public partial class Form1 : Form
12     {
13         public Form1()
14         {
15             InitializeComponent();
16         }
17 
18         private void Form1_Load(object sender, EventArgs e)
19         {
20             this.AcceptButton = button1;
21         }
22 
23         private void button1_Click(object sender, EventArgs e)
24         {
25             MessageBox.Show("引发了接受按钮1");
26         }
27 
28         
29     }
30 }

技术分享

this.AcceptButton = button1;只是能对选中的按钮进行操作,并不能对未选中的进行操作。

this.AcceptButton = button1的用法:

标签:

原文地址:http://www.cnblogs.com/liuyaozhi/p/4973280.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!