Because otherwise (if overriding OnPaint rather than handling the Paint event) the Paint event will not get raised. I normally do it at the end of the method i.e. after all painting, however if there is some custom action that needs doing after all paint handlers have finished then base.OnPaint(e) should be called before then. Edit: I've just followed the link a reread your post - In my point before I had suggested overriding OnPaint rather than handling the Paint event which is where the confusion comes from! I prefer to override OnPaint if painting as I can be sure that no subscribers to the Paint event will be called until I've done with painting. If I paint in the Paint event handler then other subscribers may already have been notified yet my painting hasn't even begun!
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Saturday, January 2, 2010 9:32 AM