我需要帮助,所以当我按下用户控件中的按钮时,表单内的面板会改变颜色 [英] I need help on making it so when I press a button in a user control, the panels inside the form changes color
问题描述
现在,我有ucModule5,这是我的用户表单的名称。该页面是设置页面。在那里,我有按钮,当你点击按钮改变颜色。现在我已经将所有按钮改为颜色,但我遇到了问题。我不知道如何编码,所以当我按下按钮时,表格内的面板会随着按钮改变颜色。
我尝试了什么:
我已经尝试过我所知道的一切。我已经让按钮工作了,但那些都在用户控件中。但由于面板是表格的一部分我不知道该怎么做。
So right now, I have ucModule5, which is the name of my user form. That page is the settings page. In there, I have buttons that when you click the buttons change color. Now I already got all the buttons to change to color, but I've ran into a problem. I don't know how to code it so when I press the button, the panels inside the form change color with the button.
What I have tried:
I have tried everything I know. I've gotten the buttons to work, but those are in the user controls. But since the panels are part of the form i dont know what to do.
推荐答案
你在寻找这个吗?
Are u looking for this?
panel1.BackColor = Color.Red;
这篇关于我需要帮助,所以当我按下用户控件中的按钮时,表单内的面板会改变颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!