Click here to Skip to main content
12,944,475 members (51,124 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 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
Top Experts
Last 24hrsThis month
OriginalGriff 4,651
CHill60 3,055
Maciej Los 2,423
Jochen Arndt 1,910
ppolymorphe 1,765

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 29 May 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100