当前位置:首页 > 开发 > C# > 正文内容

C# Winform 禁止控件因方向键切换焦点

C#4年前 (2023-02-01)
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
    switch (keyData)
    {
        case Keys.Up:
        case Keys.Down:
        case Keys.Left:
        case Keys.Right:
            return true;
    }
    return base.ProcessCmdKey(ref msg, keyData);
}


转载请注明出处。

本文链接:http://www.pythonopen.com/?id=283

相关文章

DotfuscatorPro使用教程

DotfuscatorPro使用教程

1首次使用,添加反编译工具路径ILASM_v4.0.30319C:\Windows\Microsof...

C# 缩减代码量的一些方式

static void Main() { Thread thre...

C# BackgroundWorker,在DoWork里更新控件内容

一般情况下不可以直接在BackgroundWorker的DoWork事件中更新 UI 控件在Back...

C# Control防闪烁

SetStyle(ControlStyles.AllPaintingInWmPaint |...

C# Graphics文本抗锯齿

g.TextRenderingHint = TextRenderingHint....

C# using与多重using

1. using 语句概述在 C# 中,using 语句主要用于确保实现了 IDisposable...