I have a problem with this sample. I just downloaded it and run it (Visual Studio 2010). I haven't touched anything.
Sorry for the Language, it is in italian. From top to bottom it says:
Note that:
xxx.designer.cs
while I add some new control, such as toolstripmenu, etc, or I add some new Event Handler for some control.I really don't understand what's happening.
Edit By JT: The repro is here: sdrv.ms/1kIhI5o
Repro steps:
Open solution
Select the flowLayoutPanel1 control
Run the application
Stop the application
Now try to select the gameWrapper!
Result:
The gameWrapper control cannot be selected anymore, it doesn't even show up in the Property Windows dropdownlist of form controls!
I have seen this occur in a few scenarios.
1) Project gets a reference to itself.
If you have a usercontrol in project A, and use the design to add the usercontrol to a form also in project A, Visual Studio will add a self reference which will screw up the designer.
2) Making an abstract base class for a visual element.
Since abstract classes can't be instantiated, the designer will not be able to create an instance to render in the designer.
3) DesignMode bug
If you are using the DesignMode property to determine whether or not UserControls should load data in an event like Load(), you need to know that DesignMode will break if you nest controls more than one level deep. You can get around this by creating your own designmode variable by keying off of LicenseManager.UsageMode.
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