Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Color
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.
Posted 28-May-12 22:05pm
db7uk at 29-May-12 4:09am
winforms, wpf?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
0 Shai Vashdi 339
1 Sergey Alexandrovich Kryukov 285
2 OriginalGriff 280
3 Peter Leow 171
4 Abhinav S 168
0 Sergey Alexandrovich Kryukov 8,979
1 OriginalGriff 5,280
2 Peter Leow 4,010
3 Maciej Los 3,535
4 Abhinav S 3,263

Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid