On paint calling order
-
Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance
-
Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance
-
Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance
At the end of the dialog's OnPaint method post a custom message to the dialog. In that custom message handler paint your text.
void CMyDialog::OnPaint()
{
...
CDialog::OnPaint()PostMessage(WM\_APP + 1, 0, 0);
}
LRESULT CMyDialog::OnWmAppPlusOne(WPARAM, LPARAM)
{
ClientDC dc(this);
dc.TextOut(...);
}Now all the usual painting is done first, then you custom message gets processed to draw the text on top of all the other controls.
You may be right
I may be crazy
-- Billy Joel --Within you lies the power for good, use it!!!
-
Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance
-
Hi I have a picture box in my dialog, but I need to write something on top of it. The problem is that the onPaint dialog method is getting called before the control repaints itself, so I can never see the text. Someone knows what can I do to avoid this, and be able to write on top of the picture box? Thanks in advance
Add the
WS_CLIPCHILDREN
style to the dialog, so the dialog's window proc won't paint over its child controls.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?