首页 > 解决方案 > 检测对另一个 userControl 的点击而不是当前的点击

问题描述

我为一个项目创建了一个会话选择器。会话由 userControl 表示,其动态定位在面板中

I would like that when I press a UserControl of a session, this one changes it backColor into a color and that when another userControl than this one is selected that the color is removed on the current userControl and put on the new one

我不知道这是否很清楚,但这是我试图做的:

private void UserControl_Seance_Click(object sender, EventArgs e)
{
    isClicked = true;
    this.BackColor = Color.Blue;          
}

但是代码停在那里,因为我不知道如何检测对另一个用户控件的点击而不是这个

有没有人有解决方案来检测对另一个 userControl 的点击而不是当前的?谢谢你。

标签: c#user-controls

解决方案


推荐阅读