• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

Global Form Changes

I want to change the background color of all the forms, labels, textboxes, etc.... at runtime in a module or something.  Is there an easy way to do this.  This issue is I don't want to have to manually edit each form.

Any input would be appreciated.

Thanks in advance.
0
Baddogi
Asked:
Baddogi
1 Solution
 
bobbit31Commented:
if your command buttons are all graphical:

Public Sub changeColor(frm As Form, clr As Long)
frm.BackColor = clr
For Each cntrl In frm.Controls
    cntrl.BackColor = clr
Next
End Sub
0
 
bobbit31Commented:
you'll still probably have to do some tweaking (especially if using frames)
0
 
hesCommented:
For Loaded Forms:

Dim MyForms As Form
For Each MyForms In Forms
  MyForms.BackColor = vbBlue
Next
0
 
rspahitzCommented:
One way is to change the contents of the .frm!  Locate the desired control by reading through the .frm, then change the color setting.

Also, if you want your form to always match a windows setting, you can have it reference the system colors rather than the palette...or vice-versa.
0
 
BaddogiAuthor Commented:
Thanks - that'll do the trick........  :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now