By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,401 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,401 IT Pros & Developers. It's quick & easy.

Order of base class "OnWhatever()" calls

P: n/a
Hi there,

When overriding form/control functions like "OnLoad()", "OnFormClosed()",
etc., should the base class version be called before or after your own code.
The docs say nothing about this nor give any guidance. It probably depends
on the function itself so are you supposed to determine this. Thanks.
Nov 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jim,
>When overriding form/control functions like "OnLoad()", "OnFormClosed()",
etc., should the base class version be called before or after your own code.
Unless the documentation explicitly says something about this, it's up
to you to decide if you want your own code to run before or after the
base class'. Sometimes, for example with painting, it makes a
significant difference (who paints over who), but you can't say that
one way is more correct than the other.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '06 #2

P: n/a
Unless the documentation explicitly says something about this, it's up
to you to decide if you want your own code to run before or after the
base class'. Sometimes, for example with painting, it makes a
significant difference (who paints over who), but you can't say that
one way is more correct than the other.
Ok, thanks for the feedback.
Nov 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.