Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background color

Status
Not open for further replies.

Seeff

Programmer
Dec 2, 2002
33
IL
Hi....I would like to change the background color of my application.
I know I have to use an API call. Anyone know how to do this? Let's say I would like to change from the grey default to light yellow. Thanks!
 

Not necessarily, depends upon what language you are using. If you are using VB you can change a forms back color in the properties box in the design environment. You can also do the same thing with Access Forms.

[tt]
Me.BackColor = vbYellow
[/tt]

Good Luck

 
I am not programming in VB, that is the reason I need an API call.

 
You should handle the WM_ERASEBKGND message yourself instead of letting it be handled by the default window procedure (or, if you want the background color to be static, you could supply a different brush to the WNDCLASS structure).
 
WM_CTLCOLORBTN
WM_CTLCOLORDLG
WM_CTLCOLOREDIT
WM_CTLCOLORSCROLLBAR
WM_CTLCOLORSTATIC

This is for some other window types. You can look these messages up for further information or check out a site like =-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top