Open Visual 2010, create a new form, since it is the login window, so that it does not appear to maximize, minimize and drag size function (the previous section has already mentioned how to set the size), even the form's Text property value is "Login window", size arbitrary.
After the form is created, the detailed component layout of the interface begins, mainly by dragging the control on the left and then putting it into the form to define the property value. These are relatively simple.
In the Code response phase, double-click the Login button to enter the code view:
private void Button1_Click (object sender, EventArgs e)
{ String name = this.textBox1.Text; // 获取里面的值 String password = this.textBox1.Text; if (name.Equals("admin") && password.Equals("admin")) // 判断账号密码是否等于admin { MessageBox.Show("登录成功"); } else { MessageBox.Show("登录失败!"); } }
Simple login interface for C # design