2018-09-13

2018-10-15  本文已影响0人  李大炮666

李俊男2017270308

一、登录界面

1.PNG

二、登录界面实现的功能描述

1.将收银员与管理员分开

2.识别用户名与密码的正确与错误,并给出相应提示

3.当用户忘记密码时,也可通过linkable插件找回密码

三、登录界面各控件的参数设置

Button1

属性
text 登录

Button2

属性
text 退出

comBox1

属性
Dropdownstyle 滚动查询

Lable1

属性
text 用户管理

Lable2

属性
text 账号

Lable3

属性
text 密码

textBox2

属性
maxlenth 9
passworldchar *

Linklabel1

属性
text 忘记密码?

pictureBox1

属性
backgroundlmage picture

四、重要方法描述

 private void Form1_Load(object sender, EventArgs e)
        {
            comboBox1.Text = ("收银员");
        }
private void button1_Click(object sender, EventArgs e)
        {
            if (!textBox1.Text.Equals("123456") || !textBox2.Text.Equals("123456"))
            {
                MessageBox.Show("用户名或密码错误,请重新输入!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                textBox1.Clear();
                textBox2.Clear();
                textBox1.Focus();
            }
            else
            {
                MessageBox.Show("欢迎使用智能收银系统", "提示", MessageBoxButtons.OK);
                this.Close();
            }
        }

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    SendKeys.Send("{tab}");
                }
            }
        }
 private void textBox2_Enter(object sender, EventArgs e)
        {
            ((TextBox)sender).SelectAll();
        }

private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    if (!textBox1.Text.Equals("123456") || !textBox2.Text.Equals("123456"))
                    {
                        MessageBox.Show("用户名或密码错误,请重新输入!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                        textBox1.Clear();
                        textBox2.Clear();
                        textBox1.Focus();
                    }
                    else
                    {
                        MessageBox.Show("欢迎使用智能收银系统", "提示", MessageBoxButtons.OK);
                        this.Close();
                    }
                }
            }
        }
    }
}

五、尚需完善的功能

1.需要将数据库与用户界面连接起来

2.可以使用其他方式进行登录,如手机快捷登录,扫码登录等

3.界面自适应

上一篇 下一篇

猜你喜欢

热点阅读