1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| BOOL Test::OnInitDialog()
{
CDialog::OnInitDialog();
Police();
this->LoadImg("bla.gif");
this->Invalidate();
return TRUE;
}
//change la police, marche bien
void Test::Police()
{
LOGFONT LogFont;
.......
pStatic->SetFont(pFont);
}
//change couleur texte et fond de texte, marche bien
HBRUSH Test::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
........
return hbr;
}
//Créée a partir du ClassWizard
void Test::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct != NULL);
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
CRect itemRect = lpDrawItemStruct->rcItem;
if(m_Picture.m_IPicture)
{
m_Picture.UpdateSizeOnDC(pDC);
m_Picture.Show(pDC, CPoint(0,0), CPoint(m_Picture.m_Width, m_Picture.m_Height), 0,0);
m_Picture.Show(pDC,itemRect);
}
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
} |
Partager