更改打开表单的颜色
我有一个应用程序,最终用户可以在运行时更改表单、文本框、标签、按钮的颜色。假设打开一个表单并且用户将表单颜色从蓝色更改为绿色。为了影响颜色设置,当我在 Form_Load 事件中设置表单颜色时,必须关闭并重新打开现有表单。我看到许多应用程序,其中颜色的变化适用于所有打开的表单、按钮、标签等。
请建议我实现动态表单着色的适当方法。 非常感谢您的帮助。
I have an application where in the end user can change the color of the form, textboxes, labels, buttons during run time. Let us say that if a form is opened and the user has changed the form color from blue to green. To affect the color settings the existing form has to be closed and re-opened as I'm setting the form color in the Form_Load event. I saw many applications where-in the changes of color would apply to all open forms, buttons, labels etc.
Kindly suggest me appropriate methods to achieve dynamic form coloring.
Your help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您更改表单的
BackColor
。任何需要重新打开表格。更改表单的背景颜色,并递归地更改子表单,如下所示:
You change the form's
BackColor
. Any need to reopen the form.Change the Backcolor of the form, and recursively the childs, à la: