Mancora
07-10-2005, 09:44 PM
Ok, so i understand the point where the OnPaint method inside the form is called and raises the event by invoking the delegates registered with it, but i dont get what happens before that.
I would have been tempted to say painting the background and getting components to paint themselves would have been one of the delegates registered with it, but i can tell thats not the case because i overrode the OnPaint(...) method to do nothing and the form's background still painted fine.
Unlike my last posts i've actually been looking for this for a while, saturday night most of today today and been trying to dig up info at msdn.
I've found info talking about win32 and COM stuff (or at least thats where msdn puts it when i cross reference with them), that usually goes like this.
The prime suspect is usually the WM_ERASEBKGND message. This message is sent to a window when it's background needs to be erased. This happens because windows are usually painted using a 2-stage process:
* WM_ERASEBKGND: Clear the background
* WM_PAINT: Draw the contents on top
And this idea of drawing the background then drawing the the contents reminds me of other stuff i've read even if the names aren't right, but what is done with this message in .Net?
Does it call a method in the form object? What does this method do (is it the invalidate method?), who does it call? How can i stop it from painting the background and painting on top?
Also, can the equivelent of a system paint message be triggered from inside the form (and by whom?)?
I would have been tempted to say painting the background and getting components to paint themselves would have been one of the delegates registered with it, but i can tell thats not the case because i overrode the OnPaint(...) method to do nothing and the form's background still painted fine.
Unlike my last posts i've actually been looking for this for a while, saturday night most of today today and been trying to dig up info at msdn.
I've found info talking about win32 and COM stuff (or at least thats where msdn puts it when i cross reference with them), that usually goes like this.
The prime suspect is usually the WM_ERASEBKGND message. This message is sent to a window when it's background needs to be erased. This happens because windows are usually painted using a 2-stage process:
* WM_ERASEBKGND: Clear the background
* WM_PAINT: Draw the contents on top
And this idea of drawing the background then drawing the the contents reminds me of other stuff i've read even if the names aren't right, but what is done with this message in .Net?
Does it call a method in the form object? What does this method do (is it the invalidate method?), who does it call? How can i stop it from painting the background and painting on top?
Also, can the equivelent of a system paint message be triggered from inside the form (and by whom?)?