버튼 DrawItem
C언어,ARM / 2020. 4. 11. 23:26
버튼 DrawItem
void xButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
...
TCHAR sCaption[1024];
RECT r=lpDrawItemStruct->rcItem;
GetWindowText(sCaption,_countof(sCaption));
pDC->SetBkMode(TRANSPARENT);
if(lpDrawItemStruct->itemState & ODS_DISABLED)
{
pDC->SetTextColor(GetSysColor(COLOR_3DHILIGHT));
pDC->DrawText(sCaption,&tr,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
OffsetRect(&tr,-1,-1);
pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT));//pDC->SetTextColor(m_TextColor);
pDC->DrawText(sCaption,&tr,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
else
{
//Nomal
if((lpDrawItemStruct->itemState & ODS_SELECTED))//Pushed
{
...
OffsetRect(&tr,1,1);//shift text
}
pDC->SetTextColor(m_TextColor);
pDC->DrawText(sCaption,&tr,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
...
}
'C언어,ARM' 카테고리의 다른 글
디지털 오실로스코프 프로그램 (0) | 2020.04.18 |
---|---|
fatal error LNK1120: 1개의 확인할 수 없는 외부 참조입니다. - GetRuntimeClass (1) | 2020.04.18 |
Visaul Studio 2012에서 특정 코드에 break point 적용이 안되는 문제 (0) | 2020.03.21 |
error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. (1) | 2020.03.21 |
PC의 ip얻기 (0) | 2020.03.21 |