1. 登錄界面的效果圖
2. 登錄界面實(shí)現(xiàn)的功能描述
該界面主要是為指定的用戶(hù)可以更快更安全的進(jìn)入商超管理系統(tǒng)。用戶(hù)首先選擇登錄用戶(hù)類(lèi)型,然后輸入自己的用戶(hù)名和密碼點(diǎn)擊登錄就可以登錄相應(yīng)的商超系統(tǒng)頁(yè)面。不同的身份類(lèi)型所訪問(wèn)到的頁(yè)面也是不同的
3. 登錄界面各控件的參數(shù)設(shè)置
以列表的方式,列出各個(gè)控件的重要參數(shù)設(shè)置。
| 屬性 |
值 |
| TEXT |
用戶(hù)登錄 |
| MaximizeBox |
False |
| MinimizeBox |
False |
| StartPosition |
CenterScreen |
label1
label2
label3
Linklabel1
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("用戶(hù)名或密碼錯(cuò)誤", "提示", 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}");
}
}
}
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。