当前位置:首页 > 开发 > 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# string与Hex互转

StrToHex    /// <summary>...

C# 捕获鼠标

方式一-API    /// <summary>...

C# 可空参数

using System; using System.Runtime.Inte...

C# ref 和out

ref关键字概念:ref是 C# 中的一个关键字,用于按引用传递参数。当在方法调用中使用ref关键字...

C# Graphics图像抗锯齿

g.SmoothingMode = SmoothingMode.AntiAlia...