Bonjour,

j'ai écrit ce code pour avoir des controles transparent:
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
41
42
HBRUSH EOBD_MODE5::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
 
	// TODO: Change any attributes of the DC here
	CBrush Temp;
	CBitmap BTemp;
	CPoint m_pts;
	RECT m_rect;
 
 
	  // Are we painting the IDC_MYSTATIC control? We can use
  // CWnd::GetDlgCtrlID() to perform the most efficient test.
	//si c des controles qui nous interressent:
	if ( (nCtlColor == CTLCOLOR_BTN)|(nCtlColor == CTLCOLOR_LISTBOX))|(nCtlColor == CTLCOLOR_STATIC))
	{
		// Set the text color to red.
		pDC->SetTextColor(RGB(255, 0, 0));
		// Set the background mode for text to transparent 
		// so background will show thru.
		pDC->SetBkMode(TRANSPARENT);
		// Return handle to our CBrush object.
 
		//on recupere la position du controle
		pWnd->GetWindowRect( &m_rect );
		//on recuper le bord haut gauche
		if ( nCtlColor != CTLCOLOR_BTN )
			m_pts.x = -m_rect.left-1;
		else
			m_pts.x = -m_rect.left;
		m_pts.y = -m_rect.top+25;//+25 => c'est la barre de menu!
 
		//on change la position du pinceaux pour reprendre l'image au bon endroit
		pDC->SetBrushOrg(m_pts);
		//on affecte la position du pinceau au controle.
		hbr = m_brush;
	}
 
 
	// TODO: Return a different brush if the default is not desired
	return hbr;
}
ca marche très bien, sauf pour les controle check box, ou le repositionnement de la brush ne serait pas pris en compte...
j'ai éssayé de virer les 2 autres controles static text, mais ca change rien.
pareil si je laisse un seul check box...

j'aurais fait une erreur?

ps: je suis sur Visual C++ 4 embedded ( developpement pocket pc ).

merci d'avance