Dialog und Hintergrundfarbe
-
Hallo,
so setze ich meine Dialog Hintergrund:
HBRUSH CDeinDialolg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);switch(nCtlColor)
{
case CTLCOLOR_BTN:
case CTLCOLOR_STATIC:
pDC->SetBkMode(TRANSPARENT);
case CTLCOLOR_DLG:
return(HBRUSH) m_brBack.GetSafeHandle();
}return CDialog::OnCtlColor(pDC,pWnd,nCtlColor);
}Das funktioniert auch soweit.
Nur nich bei XP?
Wenn ich den Dialog minimiere, und anschliessend wieder maximiere, dann hat er die Farbe.
Nur nich beim ersten mal....Gibt es für XP eine andere Methode
-
hmm.. komisch... hatte bisher noch nie probleme damit.
So ausm bauch raus würde ich mal versuchen ein RedrawWindow in der OnInitDialog aufzurufen
-
Oder Invalidate(); ausführen könnte auch helfen.
-
Hat sich erledigt.
Danke für eure Antworten....
-
Und was war nun die Lösung?