挂机锁,支持自定义提示public Form1()
{
InitializeComponent();
_Init();
}
private void _Init()
{
textBox1.Text = "正在挂机,请勿打扰...";
this.MinimizeBox = false;
this.MaximizeBox = false;
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox2.Text.Trim()=="" ||textBox3.Text.Trim()=="")
{
MessageBox.Show("请输入密码!","提示");
return;
}
if (textBox2.Text.Trim() != textBox3.Text.Trim())
{
MessageBox.Show("两次密码不一致!","提示");
return;
}
if (string.IsNullOrEmpty(textBox1.Text.Trim()))
{
textBox1.Text = "挂机中...";
}
Form2 frm2 = new Form2();//实例化F2窗体
frm2.s = this.Size;//传递窗体大小
frm2.X = this.Location.X;//传递窗体的X坐标
frm2.Y = this.Location.Y;//传递窗体的Y坐标
frm2.info = textBox1.Text.Trim();//传递挂机信息
frm2.pwd = textBox2.Text.Trim();//传递解锁密码
this.Hide();//隐藏当前窗体
frm2.ShowDialog();//打开 f2窗体
}
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
评论