Changing property of multiple controls in a form

alphaex32

New member
Local time
Today, 18:23
Joined
Aug 18, 2005
Messages
7
Basically what I need to do is have a button which will change the background color of all text controls in a form. I understand this can be done easily in VB if the controls all have incrementing names (txt1, txt2, etc.), however my controls all have descriptive names. How could I accomplish this using either a macro or VB code?
 
RE: Changing properties

In the on click property of your button use the following code

Yourlabel1.ForeColor = 255
Yourlabel2.forecolor = 65535
etc

255 = Red
65535 = Yellow

You can change the background colour by using backcolor instead of forecolor
 

Users who are viewing this thread

Back
Top Bottom