您的位置:首页 > 其它

this.AcceptButton = button1的用法:

2015-11-17 23:53 387 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Test02
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.AcceptButton = button1;
}

private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("引发了接受按钮1");
}

}
}




this.AcceptButton = button1;只是能对选中的按钮进行操作,并不能对未选中的进行操作。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: