Results 1 to 4 of 4

Thread: Color

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024

    Color

    How I change the background color on a read only edit box?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    juz detect the WM_CTLCOLORSTATIC message inside the WndProc will do...

    PHP Code:
    case WM_CTLCOLORSTATIC:
        
    // Change the static control background color
        // Ref.
        // wParam - handle to static control DC (HDC)
        // lParam - handle to static control handle (HWND)
        
        
    if ((HWND)lParam == hWndEdit1)
        {
            
    // Change text color
            
    SetTextColor((HDC)wParamRGB(2550255));
            
    // Change background color
            
    SetBkMode((HDC)wParamTRANSPARENT);
            return (
    long)hBrush2;
        }
        break; 
    regards,
    Attached Files Attached Files

  3. #3

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Thanks it worked great after I figured out what hBrush was doing.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    lol... the return hBrush is important.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width