Solved

Global Form Changes

Posted on 2002-07-24
5
194 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

747 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

14 Experts available now in Live!

Get 1:1 Help Now