CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    4

    Problem with changing color of Static box



    Hello

    HBRUSH COptionsDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)

    {

    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

    // TODO: Change any attributes of the DC here

    CWnd* StaticWnd;

    StaticWnd = GetDlgItem(IDC_COLORPICK);

    if(nCtlColor == CTLCOLOR_STATIC && StaticWnd == pWnd)

    MessageBox("Static color event"

    // TODO: Return a different brush if the default is not desired

    return hbr;

    }

    The if statement is always FALSE, and i can't grab my Static box to change it color...

    please help me

    Thank You


    P.S.

    also i don't know what is the way of changing color of this static control...maybe fillsolidrect????

  2. #2
    Join Date
    Mar 1999
    Posts
    6

    Re: Problem with changing color of Static box



    Hi,


    Compare the window handles.


    And to change the color of the static box, create a brush using CBrush().


    Good Luck.

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

Featured