Related BackColor/ForeColor Question

J

Joe Williams

Is there a way to declare the color of all the controls on a form without
explicitly declaring each control name in code?

I am trying to set up a color pallette that the user can define for
themselves and thus would change the foreground and background colors of
every form and control when they are opened, based on that users selections

Thanks

Joe
 
B

B. Comrie

On Error Resume Next ' Used to override errors on controls that don't
support the property you are referencing.
Dim ctrl as Control 'Create a control to reference
For Each ctrl in Me.Controls' Loop through the controls on the form
ctrl.Property = TheValue' Set a Property value for the control
Next

Note....
Using custom colors on a form will greatly decrease the speed of your
database on some machines and definitely if you are using a remote desktop
or Terminal services. It is best to use the standard theme provided by
Microsoft.

They put a lot of research into the color schemes they use, and support them
throughout their applications and operating systems..

B Comrie
http://www.codewidgets.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top