C# Windows Forms Design-time Form constructor not called?
问题 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... 回答1: 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