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

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

C#3年前 (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

相关文章

C# System.IO.Path

System.IO.Path.GetExtension返回指定的路径字符串的扩展名。string&n...

C# ref 和out

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

C# Byte[]转为Bitmap

在 C# 中,可以使用System.Drawing命名空间下的相关类将byte[]类型的数据转换为B...

C# MemoryStream转为Image

        //...

C# Graphics文本抗锯齿

g.TextRenderingHint = TextRenderingHint....

C# TextRenderer.MeasureText

TextRenderer.MeasureText是System.Windows.Forms命名空间中...