Constructor - Load method
-
Hello, I have a Form of a Smart Device Application with a constructor and a defined Form_Load event. When i the form is created which method is first executed - the constructor or the Form_Load?? regards pat
-
You can quickly check this by putting breakpoint in both Constructor and Form_Load method and run it. See which one gets called first... Sandeep Naik
Or with logic: does it make sense for any method to be called before a constructor? By the way, if you have multiple constructors and you're using the debugger method suggested, may want to put breakpoints in all of them. Matt Gerrans
-
Hello, I have a Form of a Smart Device Application with a constructor and a defined Form_Load event. When i the form is created which method is first executed - the constructor or the Form_Load?? regards pat
When instantiating ANY class, the constructor is always the first thing that is called.
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
-
When instantiating ANY class, the constructor is always the first thing that is called.
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
Well, heck, if you were just going to blurt it out, couldn't you have done it in the form of a Vogon poem? ;) Matt Gerrans
-
Well, heck, if you were just going to blurt it out, couldn't you have done it in the form of a Vogon poem? ;) Matt Gerrans
Matt Gerrans wrote: couldn't you have done it in the form of a Vogon poem? I tried once, but I got these intestinal cramps and an inexplicable urge to gnaw off my right leg.
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
-
Or with logic: does it make sense for any method to be called before a constructor? By the way, if you have multiple constructors and you're using the debugger method suggested, may want to put breakpoints in all of them. Matt Gerrans
Yes, static methods and type constructors. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]
-
When instantiating ANY class, the constructor is always the first thing that is called.
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
Actually, the static initializer (.cctor) is the first thing ever called, but only the first time for a type within a given AppDomain. But as far as instances go, yes you're right. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]
-
Yes, static methods and type constructors. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]
Well, yes, if you want to pick nits. If you insist, instead of "does it make sense for any method to be called before a constructor?" it should be "does it make sense for any instance method to be called before a constructor?" or perhaps "does it make sense for any static method to be called before a type constructor?" or maybe the two combined. Matt Gerrans