标签运行时颜色变化 [英] label Color change at runtime

查看:92
本文介绍了标签运行时颜色变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在Windows应用程序上工作.因此,我想在运行时在所有表单上更改所有标签的颜色.我已经完成了更改标签颜色的代码.但是需要对每个标签执行相同的代码.有什么解决办法.请告诉我怎么做.

谢谢.

Hello,

I am working on windows application. In that I want to change color of all labels at runtime on all forms. I have done code which change color of labels. But need to do same code for each label. Is there any solution. Please tell me how to do it.

Thanks.

推荐答案

假设您正在使用Windows Forms,则可以遍历所有控件并将逻辑应用于所有找到的标签.例如,参见
如何在Windows Form App中迭代控件? [ ^ ]在Stack Overflow.
Supposing you are working with Windows Forms, then you may iterate over all controls and apply your logic to all the found labels. See, for instance
How do I iterate controls in a Windows Form App?[^] at Stack Overflow.


这篇关于标签运行时颜色变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆