using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;namespace KFEMR { public partial class Form3 : Form { public Form3() { InitializeComponent(); } private void button_Click(object sender, EventArgs e) { textBox1.Text+=((Button)sender).Text; } private void Form3_Paint(object sender, PaintEventArgs e) { for (int i = 0; i < 26; i++) { Button bt = new Button(); bt.Text=((char)(65+i)).ToString(); flowLayoutPanel1.Controls.Add(bt); bt.Click += new EventHandler(button_Click); } } } }大致就是这样。
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace KFEMR
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
} private void button_Click(object sender, EventArgs e)
{
textBox1.Text+=((Button)sender).Text;
} private void Form3_Paint(object sender, PaintEventArgs e)
{
for (int i = 0; i < 26; i++)
{
Button bt = new Button();
bt.Text=((char)(65+i)).ToString();
flowLayoutPanel1.Controls.Add(bt);
bt.Click += new EventHandler(button_Click);
}
}
}
}大致就是这样。
错误 1 当前上下文中不存在名称“button_Click”
就像建行的网上银行一样