我正面临“ Arrow keys and changing control's focus hang the application”中提出的相同问题。由于我的积分不足,因此无法对此发表评论。因此,我发布了一个新的。
谢谢。
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();
}
}