Thread: How do I change background color?

  1. #16
    Registered User kinghajj's Avatar
    Join Date
    Jun 2003
    Posts
    218

    I found it!

    I found the problem! It's because I WAS using 'WS_EX_CLIENTEDGE'. I guess that it makes a special border around the control.
    I've also changed some code so that the background is the button face ( I used GetSysColor() )

  2. #17
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I've also changed some code so that the background is the button face ( I used GetSysColor() )
    No need to do that:
    Code:
    wcx.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1);
    That code specifies the button face color, without calling an extra function. You can do other colors that way too. Just search your header include files for COLOR_BTNFACE, and you'll all the other constants next to it. Remember to always +1.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Change text color in C
    By IndioDoido in forum C Programming
    Replies: 9
    Last Post: 04-15-2007, 05:54 AM
  2. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 06:23 PM
  3. winxp style background color problem
    By johny145 in forum Windows Programming
    Replies: 0
    Last Post: 07-06-2005, 10:22 AM
  4. How to change the Background of window
    By gaurav07 in forum Windows Programming
    Replies: 11
    Last Post: 06-27-2005, 12:48 PM
  5. Setting the background color of my main window
    By Garfield in forum Windows Programming
    Replies: 5
    Last Post: 07-06-2002, 11:25 PM