当前位置:首页 > 开发 > 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# 监控剪贴板

命名空间    using System.Runtime.I...

C# BackgroundWorker

1.概述BackgroundWorker是一个在 WinForms 应用程序中用于简化在后台线程执行...

C# BackgroundWorker的例子

以下是一个使用 BackgroundWorker 组件在 C# 中实现后台执行任务,同时在主线程更新...

C# System.IO.Path

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

C# OnMeasureItem

1. **整体功能概述**   - `OnMeasureItem` 是一个在Wi...

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

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