I have a base custom control type.
There are a number of controls that inherit from the base. In most cases, the logic of the inherited class is minimal: just providing some settings that the code in the base uses.
Nonetheless, despite the simplicity of these inherited controls, some of them consistently work fine in design view and some of them cause errors in Visual Studio's UI, which often require me to restart the designer, or even Visual Studio.
I'm hoping I've just found the answer, though.
I noticed that in two of these inherited controls - where one always worked and the other always caused trouble - the working one had a controlname.designer.vb code file, and the failing one had
#Region " Windows Form Designer generated code "
section.
I tried creating a designer file for the failing control, and copied the region into it.
Voila! It started working perfectly, every time!
Looks like Visual Studio 2010 doesn't play nice with "Windows Form Designer generated code" blocks.
No comments:
Post a Comment