windowForms如何将做好的窗体链接到一起

来源:百度知道 编辑:UC知道 时间:2024/06/20 11:08:44
就是说一个登陆窗体 登陆成功跳转到另一个 这个用什么语句

private void button1_Click(object sender, EventArgs e)//登录
{
if (txt_id.Text.Trim().Length == 0 || txt_pwd.Text.Trim().Length == 0)
{
MessageBox.Show("用户名和密码不能为空!", "提示:");
return;

}
DataSet myset = Class_data.oracle_dataset("select * from yonghu where username='" + txt_id.Text.Trim() + "' and pwd='" + txt_pwd.Text.Trim() + "'");
if (myset.Tables[0].Rows.Count >= 1)
{
this.Hide(); //隐藏当前窗体
Form_main fm = new Form_main();
fm.Show(); //把下一个窗体show出来
}
else
{
MessageBox.Show("用户名或者密码不正确!", "提示:");
}

}