2018-10-21

1. 登录界面的效果图

GIF.gif

2. 登录界面实现的功能描述

该界面主要是为指定的用户可以更快更安全的进入商超管理系统。用户首先选择登录用户类型,然后输入自己的用户名和密码点击登录就可以登录相应的商超系统页面。不同的身份类型所访问到的页面也是不同的

3. 登录界面各控件的参数设置

以列表的方式,列出各个控件的重要参数设置。

属性
TEXT 用户登录
MaximizeBox False
MinimizeBox False
StartPosition CenterScreen

label1

属性
TEXT 用户类型

label2

属性
TEXT 用户名

label3

属性
TEXT 密码

Linklabel1

属性
TEXT 忘记密码?

comboBox1

属性
DropDownStyle DropDownList
SelectedIndexChanged comboBox1_SelectedIndexChanged

textBox1

属性
MaxLength 9
Click textBox1_Click
KeyPress textBox1_KeyPress
TextChanged textBox1_TextChanged

textBox2

属性
Click textBox1_Click
KeyPress textBox2_KeyPress
Enter text Box1_Enter
MaxLength 6
Passwordchar *

button1

属性
Text 登陆
UseVisualStyleBackColor False
Click button1_Click

button2

属性
Text 退出
UseVisualStyleBackColor False
Click button2_Click

4. 重要方法描述

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

    private void button1_Click(object sender, EventArgs e)
    {
        if (this.comboBox1.SelectedItem.ToString() == "收银员")
        {
            if (this.textBox1.Text == "123456789" && this.textBox2.Text == "123456")
            {
                MessageBox.Show("收银员登录成功");
            }
            else
            {
                MessageBox.Show("用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }

    private void label3_Click(object sender, EventArgs e)
    {

   }

    private void Form1_Load(object sender, EventArgs e)
    {
        this.comboBox1.SelectedIndex = 0;

    }

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.comboBox1.SelectedIndex = 0;
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {

    }

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

    private void textBox2_TextChanged(object sender, EventArgs e)
    {
    }

    private void button2_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }

    private void textBox1_Enter(object sender, EventArgs e)
    {
        ((TextBox)sender).SelectAll();
    }

    private void Form1_KeyPress(object sender, KeyPressEventArgs e)
    {
        if (e.KeyChar == (char)Keys.Enter)
        {
            SendKeys.Send("{tab}");
        }
    }

    private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
    {
        if (e.KeyChar == (char)Keys.Enter)
        {
            SendKeys.Send("{tab}");
        }
    }
    }
}



©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1. 登录界面的效果图 ![(https://upload-images.jianshu.io/upload_im...
    青禾白木阅读 243评论 0 0
  • 智能商超登录 1.登录界面 2. 登录界面实现的功能描述 实现不同用户类型登陆。 3.登录界面各控件的参数设置 控...
    落樱雨雪阅读 683评论 0 0
  • 1. 登录界面的效果图 ![0M91B9BW`MIPA($7W@Z%Q2.jpg 2. 登录界面实现的功能描述 不...
    小伙_61e3阅读 224评论 0 0
  • 1.登录界面的效果图 2. 登录界面实现的功能描述 实现不同用户类型登陆 3. 登录界面各控件的参数设置 控件A ...
    随它吧_bb4c阅读 208评论 0 0
  • 清明梦,在这种梦境中的真实感很强烈,原本我以为,清明梦是脑袋清明时候做的梦。真正看了它的定义,才明白,更接近于真实...
    可亲小汗阅读 908评论 0 1