CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Changing textColor of CMFCBUTTON in disabled state

  1. #1
    Join Date
    Sep 2019
    Posts
    30

    Changing textColor of CMFCBUTTON in disabled state

    I have the following code:
    Code:
    bool var;
    m_button.EnableWindow(var);
    If(var)
    {
    m_button.SetFaceColor((RGB(0,255,0),true);
    m_button.SetTextColor((RGB(255,255,255)));
    }
    else
    {
    m_button.SetFaceColor((RGB(0,0,255),true));
    m_button.SetTextColor((RGB(255,0,0)));
    }
    Issue is button face color changes correctly in both enabled and disabled state but text color does not change in disabled state.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,735

    Re: Changing textColor of CMFCBUTTON in disabled state

    I never used CMFCButton class, so i can only guess...
    Try to override the CMFCButton::OnDrawText method.
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)