public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
MessageBox.Show("请输入名称");
return;
}
string msg = textBox1.Text;
listBox1.Items.Add(msg);
}
}