当前位置:首页 > 开发 > 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#解析Torrent获取磁力链

NuGet添加 MonoTorrentusing MonoTorrent;string&n...

C# System.IO.Path

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

c# Invalidate、Refresh、Refreshitem、Refreshitems的功能

Invalidate方法功能概述Invalidate方法主要用于使控件的特定区域(整个控件或部分区域...

C# using与多重using

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

C# 控件判断鼠标位置

        //...