ShowDialog... Shows dialog?  
Author Message
r3n





PostPosted: Visual C# IDE, ShowDialog... Shows dialog? Top

I'm using ShowDialog on a Form control, which is called on the Shown event for my form. Works great outside VS, but here's the problem, it also works inside VS!

Not a major ball ache, but it would be nice to not have the dialog open when ever I open the form designer.

Does anybody know how to turn it off

Thanks!



Visual C#6  
 
 
Peter Ritchie





PostPosted: Visual C# IDE, ShowDialog... Shows dialog? Top

You could test the form's DesignMode property and not make the call to ShowDialog if DesignMode == true...

 
 
r3n





PostPosted: Visual C# IDE, ShowDialog... Shows dialog? Top

Works perfectly. Thanks Peter!
 
 
r3n





PostPosted: Visual C# IDE, ShowDialog... Shows dialog? Top

Is there an attribute to disable methods being invoked at design time