|
-
October 29th, 2001, 09:30 AM
#1
CHeaderCtrl background color.
Hello:
I want to color the background of the header of a CListCtrl control.
Could anyone help me!
Thanks.
-
June 19th, 2012, 03:57 AM
#2
Re: CHeaderCtrl background color.
if you want is changing color of main column list of CListCtrl...
i tried this, and i could not this, but, finally, i did....write for memory
1.make sub class of CHeaderCtrl. it is a derived class of CHeaderCtrl.
2.massage fuction about NM_CUSTOMDRAW is needed..
3.if above is ok, the function like "void ~~~::OnNMCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)" are made.
4.code is..
void COwnHeader::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
//for this notification, the structure is actually a
// NMLVCUSTOMDRAW that tells you what's going on with the custom
// draw action. So, we'll need to cast the generic pNMHDR pointer.
LPNMCUSTOMDRAW lplvcd = (LPNMCUSTOMDRAW)pNMHDR;
switch(lplvcd->dwDrawStage)
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
{
CDC *pDC_ = CDC::FromHandle(lplvcd->hdc);
CRect rcItem(lplvcd->rc);
pDC_->FillSolidRect(rcItem, m_clrBk);
}
break;
default:// it wasn't a notification that was interesting to us.
*pResult = CDRF_DODEFAULT;
break;
}
}
-
June 19th, 2012, 05:44 AM
#3
Re: CHeaderCtrl background color.
The OP has probably solved this himself, or given up, or died, or moved to an isolated island
in the past 11 years!
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
June 19th, 2012, 08:31 AM
#4
Re: CHeaderCtrl background color.
This seems to be quite common lately. CodeGuru should install that vBulletin plugin that warns you when you're about to reply to an old thread like this. (Or does it already? I've never tried. )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|