首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

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

2012-04-26 
求助:在窗体1点击按钮出现窗体2using Systemusing System.Collections.Genericusing System.ComponentMo

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


感谢帮忙修改。

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

热点排行