正文
this.AcceptButton = button1的用法:
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
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;只是能对选中的按钮进行操作,并不能对未选中的进行操作。