c# - 在带有 RadioButtons 的 UserControl 表单中按下导航键后表单没有响应
问题描述
我面临着“箭头键和更改控件的焦点挂起应用程序”中提出的相同问题。由于我没有足够的积分,我无法对此发表评论。因此,我发布了一个新的。
提前致谢。
- 运行程序
- 选择任何单选按钮
- 点击按钮2
- 按 Tab 将焦点放在单选按钮上
- 按左/右导航键
- 形成挂断(不响应)。
Form1.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
ucPage11.BringToFront();
ucPage11.Enabled = true;
richTextBox1.Enabled = false;
}
private void ucPage11_SelectionChanged()
{
ucPage11.Enabled = false;
richTextBox1.BringToFront();
richTextBox1.Enabled = true;
}
}
UserControl.cs - 用户控件中有 3 个单选按钮控件。
public delegate void SelectionEventHandler();
public partial class UCPage1 : UserControl
{
//private ToggleImageControlManager toggleImgCtrlMgr;
public UCPage1()
{
this.InitializeComponent();
}
public event SelectionEventHandler SelectionChanged;
private void RBO_Click(object sender, EventArgs e)
{
SelectionChanged?.Invoke();
}
}
解决方案
推荐阅读
- reactjs - react-select Creatable:转换创建的选项
- python - python中列表列表之间的叉积
- angular - Angular:在角度依赖注入之外触发变化检测
- java - 我正在尝试阅读此文本文件
- javascript - Vue.js - 嵌套的 v-for 循环
- flutter - “对象?”类型的值 不能分配给 xxx 类型的变量
- grafana - Grafana 的警报通知模板似乎不起作用
- adb - 是否可以生根bluestacks?
- reactjs - 动画不适用于带有tailwindcss的className中的条件
- angular - 由于无法读取未定义角度的属性“键”而出现错误