Solved

Global Form Changes

Posted on 2002-07-24
5
237 Views
Last Modified: 2010-05-02
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
Comment
Question by:Baddogi
5 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 100 total points
ID: 7174748
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
 
LVL 18

Expert Comment

by:bobbit31
ID: 7174750
you'll still probably have to do some tweaking (especially if using frames)
0
 
LVL 20

Expert Comment

by:hes
ID: 7174778
For Loaded Forms:

Dim MyForms As Form
For Each MyForms In Forms
  MyForms.BackColor = vbBlue
Next
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7174828
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
 

Author Comment

by:Baddogi
ID: 7175185
Thanks - that'll do the trick........  :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now