When I try to catch the Resize event to handle sizing of MDI children, the event is called even before my forms constructor can create the children throwing an exception. How do I avoid this?
The Resize event is getting raised before the constructor completes because the form is being resized in the constructor. If you are using VS.NET to create your project, then in your constructor there is a call to InitializeComponent. In this method there is code to resize the form. You could instantiate your child form in your constructor *before* InitializeComponent is called, then when the form gets resized for the first time you already have an instance of your child form. (broderonline@microsoft.
The Resize event is getting raised before the constructor completes because the form is being resized in the constructor. If you are using VS.NET to create your project, then in your constructor there is a call to InitializeComponent. In this method there is code to resize the form. You could instantiate your child form in your constructor *before* InitializeComponent is called, then when the form gets resized for the first time you already have an instance of your child form.
Related Questions
- When I try to catch the Resize event to handle sizing of MDI children, the event is called even before my forms constructor can create the children throwing an exception. How do I avoid this?
- How do I obtain copies of Form S-240 Wisconsin Temporary Event Operator and Seller Information?
- My guest list includes 12 children. Can my MerryB Event be expanded?