Voila je cherche a peindre en noir mes dialog box mais je ne sait �las pas comment faire...
Voila je cherche a peindre en noir mes dialog box mais je ne sait �las pas comment faire...
http://cpp.developpez.com/faq/vc/ind...alogBkgndColor
ca marche aussi pour les boites de dialogues..
intercepter l'evenement ctlcolor, et modifier le handle retourn� pour le remplissage..
exemple sur un cdialog retournant des couleurs sp�cifiques pour des composants.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
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 HBRUSH processEDI::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here switch(nCtlColor) { case CTLCOLOR_BTN: case CTLCOLOR_STATIC: { pDC->SetBkMode(TRANSPARENT); hbr=(HBRUSH)::GetStockObject(NULL_BRUSH); break; } case CTLCOLOR_EDIT: { pDC->SetBkMode(OPAQUE); hbr=(HBRUSH)::GetStockObject(WHITE_BRUSH); break; } case CTLCOLOR_LISTBOX: { pDC->SetBkMode(TRANSPARENT); hbr=(HBRUSH)::GetStockObject(GRAY_BRUSH); break; } case CTLCOLOR_MSGBOX: { hbr=(HBRUSH)::GetStockObject(LTGRAY_BRUSH); break; } case CTLCOLOR_SCROLLBAR: { hbr=(HBRUSH)::GetStockObject(GRAY_BRUSH); break; } } return hbr; }
Voila,
J ai essay� le code propos� dans la Faq et j ai une erreur lorsque je fait le .h :sur la ligne :error C2061: syntax error : identifier 'CDC'je ne vois pas d ou vien l erreur.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2 HBRUSH CtlColor(CDC* pDC, UINT nCtlColor)
Partager