求助:在窗体1点击按钮出现窗体2
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 WindowsFormsApplication1
{
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
name_txt.Text = "";
bj_txt.Text = "08职考班";
}
private void button1_Click(object sender, EventArgs e)
{
if (name_txt.Text == "")
{
MessageBox.Show("姓名不得为空!");
}
else
{
Form2 myForm = new Form2();
myForm.ShowDialog();
}
}
}
}
感谢帮忙修改。
------解决方案--------------------
你这不是好好的吗