Hallo, kann mir jemand villeicht sagen, warum er die Recourse verliert
Ist doch alles da oder nicht ?
Der nachfolgende Code befindet sich in
Ist doch alles da oder nicht ?
Der nachfolgende Code befindet sich in
Code:
void CGR2Button::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
Code:
/* CBrush *pBtnBrush;
pBtnBrush = new CBrush(RGB(77, 70, 255));
CDC dc;
dc.Attach(lpDrawItemStruct->hDC); //Get device context object
CRect CBtnRect(&lpDrawItemStruct->rcItem); //Get button rect
dc.SelectObject(pBtnBrush);
dc.FillSolidRect(CBtnRect, RGB(60, 60, 255));
if(m_alarm)
dc.FillSolidRect(lpDrawItemStruct->rcItem, RGB(255, 60, 60));
else
dc.FillSolidRect(lpDrawItemStruct->rcItem, RGB(60, 60, 255));
UINT state = lpDrawItemStruct->itemState; // Get state of the button
if ( (state & ODS_SELECTED) ) // If it is pressed
{
dc.DrawEdge(CBtnRect,EDGE_SUNKEN,BF_RECT); // Draw a sunken face
}
else
{
dc.DrawEdge(CBtnRect,EDGE_RAISED,BF_RECT); // Draw a raised face
}
if ( (state & ODS_FOCUS ) ) // If the button is focused
{
// Draw a focus rect which indicates the user
// that the button is focused
int iChange = 3;
CBtnRect.top += iChange;
CBtnRect.left += iChange;
CBtnRect.right -= iChange;
CBtnRect.bottom -= iChange;
dc.DrawFocusRect(CBtnRect);
}
CString str1, str2, str3;
str1 = m_bezeich;
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(RGB(10,255,10));
dc.TextOut(10,5,str1);
delete pBtnBrush;
dc.Detach();
*/