Print Page | Close Window

Bad background color in empty CXTPListBox

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=22977
Printed Date: 24 December 2024 at 1:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bad background color in empty CXTPListBox
Posted By: JoseAngel
Subject: Bad background color in empty CXTPListBox
Date Posted: 29 March 2016 at 5:46am
Using Visual Studio 2015 dark theme, when a CXTPListBox is empty, it draws the background with COLOR_BTNFACE color.

I purpose to modify void CXTPListBox::OnPaint() from

    ...
    // Let the window do its default painting   ...
    CListBox::DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
    memDC.SetWindowOrg(ptOrg);
}

to

    ...
    // Let the window do its default painting   ...
    if( GetCount() != 0 )
        CListBox::DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
    memDC.SetWindowOrg(ptOrg);
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net