Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Global Form Changes

Posted on 2002-07-24
5
Medium Priority
?
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

636 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