zoukankan      html  css  js  c++  java
  • c# winform快捷键设置

    设置 Form 的 KeyPreview=true 然后在Form 的案件事件里判断按钮类型进行分别调用就可以了

            private void Form1_KeyDown(object sender, KeyEventArgs e)
            {
                if (!ListViewModel)
                {

                    if (e.Control)
                    {
                        switch (e.KeyCode)
                        {
                            case Keys.A:
                                addTSB.PerformClick();
                                break;
                            case Keys.S:
                                saveTSB.PerformClick();
                                break;
                            case Keys.D:
                                delTSB.PerformClick();
                                break;
                            case Keys.R:
                                redoTSB.PerformClick();
                                break;
                            case Keys.P:
                                createDocTSB.PerformClick();
                                break;
                            case Keys.F:
                                findTSB.PerformClick();
                                break;
                            default:
                                break;
                        }
                        e.Handled = true;

                    }
                }


            }

  • 相关阅读:
    POJ 2411 状态压缩递,覆盖方案数
    POJ 2774 最长公共子串
    POJ 1743 不可重叠的最长重复子串
    POJ 3294 出现在至少K个字符串中的子串
    POJ 3261 出现至少K次的可重叠最长子串
    POJ 1741/1987 树的点分治
    HDU1556 Color the ball
    解决linux系统时间不对的问题
    CentOS 6.9使用Setup配置网络(解决dhcp模式插入网线不自动获取IP的问题)
    Linux网络配置(setup)
  • 原文地址:https://www.cnblogs.com/bile/p/3369818.html
Copyright © 2011-2022 走看看