Is the constructor of a form not called upon opening the form in design view? Why not? Can I somehow force it to be called? I tested it by showing a MessageBox in the constructor, and only the MessageBox from the constructor of the form's base type (another form) is shown...
相关问题
- Laravel Option Select - Default Issue
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
- Xamarin. The name 'authorEntry does not exist
- HTML <form> tag causing Rails form to submit
相关文章
- Java call constructor from constructor
- Show a different value from an input that what wil
- How can I detect/watch “dirty-status” of an angula
- Why form submit opens new window/tab?
- What CursorAdapter have I to use?
- is Object.getPrototypeOf() same as Object.construc
- Setting Angular 2 FormArray value in ReactiveForm?
- Can RTTI interrogate types from project code at de
This behavior is by design. The form designer in Visual Studio cannot instantiate the class being designed — instead, it instatiates its immediate parent. There is no way to change this behavior. If you need some logic to be executed during design time, you have to create a separate ancestor encapsulating that logic and inherit from it.
That's also the reason why in order to be able to use the designer you cannot inherit a form from an abstract or generic class.