본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

MFC.Control. Custom Draw

by i.got.it 2020. 11. 19.

 

상세. 

 

Developing Custom Draw Controls in Visual C++

Developing Custom Draw Controls in Visual C++ 02/03/2012 15 minutes to read In this article --> Tom Archer Program Manager, Microsoft January 2006 Applies to:    Win32 API    Microsoft Foundation Classes    Visual C++ 2005 Summary: Tom Archer pres

docs.microsoft.com

 

코드예. 

 

/*
My dialog class contains a CTreeCtrl member that uses the resource ID IDC_TEST_DEF_TREE.
The method OnNMCustomdraw sets the color of the selected item. 
The message handler is registered in the message map like this:
*/

ON_NOTIFY(NM_CUSTOMDRAW, IDC_TEST_DEF_TREE, OnNMCustomdraw)


void CSelectTestDefinitionDlg::OnNMCustomdraw(NMHDR* pNMHDR, LRESULT* pResult)
{
    LPNMLVCUSTOMDRAW lpLVCustomDraw = reinterpret_cast<LPNMLVCUSTOMDRAW>(pNMHDR);
    switch (lpLVCustomDraw->nmcd.dwDrawStage)
    {
    case CDDS_ITEMPREPAINT:
    case CDDS_SUBITEM:
        if (lpLVCustomDraw->nmcd.uItemState & CDIS_SELECTED)
        {
            // Your color definitions here:
            lpLVCustomDraw->clrText = RGB(255, 255, 255);
            lpLVCustomDraw->clrTextBk = RGB(0, 70, 60);
        }
        break;

    default:
        break;
    }

    *pResult = 0;
    *pResult |= CDRF_NOTIFYPOSTPAINT;
    *pResult |= CDRF_NOTIFYITEMDRAW;
    *pResult |= CDRF_NOTIFYSUBITEMDRAW;
}

from 

 

how to change highlight color in list control in mfc

how to change highlight color in list control in mfc. i havn't found any api in clistctrl. i have override NM_CUSTOMDRAW as descripbed in msdn but when i clicked on any item on list it showing hal...

stackoverflow.com

 

 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5