zoukankan      html  css  js  c++  java
  • 快捷键重载

    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();
    }

    /// <summary>
    /// 用于捕获当前界面下按键事件
    /// 此方法继承自Form对象
    /// 如果为回车或ESC
    /// </summary>
    /// <param name="msg"></param>
    /// <param name="keyCode"></param>
    protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, Keys keyCode)
    {
    switch (keyCode)
    {
    case Keys.Escape: // ESC键
    this.Close();
    break;
    case Keys.Enter: // 点击回车事件
    MessageBox.Show("Enter");
    break;
    case Keys.D0:
    case Keys.NumPad0:
    MessageBox.Show("0");
    break;
    case Keys.D1:
    case Keys.NumPad1:
    MessageBox.Show("1");
    break;
    case Keys.D2:
    case Keys.NumPad2:
    MessageBox.Show("2");
    break;
    default:
    return false;
    }

    return true;
    }
    }
    }

  • 相关阅读:
    js的alert乱码问题
    (6)select语句
    (5)视图
    (4)索引
    (3)操作数据库
    (2)MySQL数据类型
    (1)MySQL概述
    RocketMQ安装使用
    uniapp打包h5
    面试必问 如何保证缓存与数据库的一致性
  • 原文地址:https://www.cnblogs.com/Robert-huge/p/5501279.html
Copyright © 2011-2022 走看看