Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
I don't understand the OnPaint method
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Tony Johansson, post: 13921803"] Hi! I have some problems to fully understand the OnPaint that I override in my Form class. I do understand when I have an event handler for the Paint event. I mean when I override the OnPaint method this OnPaint is not an event handler I just override an existing method that exist in a more general class higher up and say now we use my implementation of OnPaint so windows will call my OnPaint instead of the other method OnPaint. I know that my OnPaint work as following when I have a windows with graphics on and hide it by using for example the notepad and then move the notepad away so the graphics window is not hidden my OnPaint is called. From the functionallity of the OnPaint it work as if it was an event handler for the Paint event but as I mentioned it's not an event handler. If I don't override the OnPaint method but instead use an event handler for the Paint event I think it works as this. In the OnPaint that exist above the Form class in the control class perhaps this method OnPaint raise the Paint event and every subscriber that subscribe to the Paint event will be notified and the respective event handler will be called. So it might be in this way Windows call OnPaint whatever this method is implemented if I have overridden it Windows call my OnPaint that's it. It's important to call base.OnPaint in my overrideen OnPaint because if there are some subscriber to the paint event these must be notified and perhaps Windows need to do some processing in the base method OnPaint. So as a summary is this correct understood about the OnPaint method. //Tony [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
I don't understand the OnPaint method
Top