I am getting some errors thrown in my code when I open a Windows Forms form in Visual Studio's designer. I would like to branch in my code and perform a different initialization if the form is being opened by designer than if it is being run for real.
How can I determine at run-time if the code is being executed as part of designer opening the form?
From the Solution Explorer window select your form, right-click, click on View Designer. Voila! The form should display.
Visual Studio . NET is an application development tool for writing an application; the . NET Framework provides the infrastructure required to run those applications.
The Visual Studio Report Designer is a tool fully integrated into the famous IDE with WYSIWYG design surface, New Item support, Properties Grid integration, and three dedicated tool windows. This makes it a fully featured tool for creating and editing compiled (CS or VB) report definitions.
To find out if you're in "design mode":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With