frmsuoding.cs

来自「用c#编写的医院管理系统(部分源码)」· CS 代码 · 共 52 行

CS
52
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Hospital.Hospital.entity;

namespace Hospital.Hospital.view
{
    public partial class frmSuoDing : Form
    {
        public frmSuoDing()
        {
            InitializeComponent();
        }

        private void frmSuoDing_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Alt)
            {
                if (e.KeyCode == Keys.F4)
                {
                    e.Handled = true;
                }
            }
        }

        private void txtPwd_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyCode==Keys.Enter)
            {
                if(txtPwd.Text=="")
                {
                    MessageBox.Show("请输入密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (txtPwd.Text == UsersEntity.pass)
                {
                    this.Close();
                }
                else
                {
                    MessageBox.Show("对不起,您输入的密码错误,请查证后再试,谢谢合作!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    txtPwd.Text = "";
                }

            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?