读书人

:在窗体1点击按钮出现窗体2

发布时间: 2012-04-26 14:01:31 作者: rapoo

求助:在窗体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();
}

}
}
}


感谢帮忙修改。

[解决办法]
你这不是好好的吗

读书人网 >C#

热点推荐