Cause this VB6-like smell, which VB.NET allows, to error instead: WinFormType.InstanceProp=Value [DISABLE My.Forms]

No. This confusing behaviour is by design.

It has been possible in VB to use one instance of a form without creating it, and this behaviour happily made it to VB.NET. To me, this is one of the worst design choices.
But it does make converting legacy projects easier. And it does a favour to those who never even knew a form could be explicitly instantiated.

But you are not required to use this trick, as you never were in VB6. In both languages you can use explicitly created instances, in which case the default instance will not be created. Just forget this “feature” exists and only let it back to your mind when enlightening others.

Leave a Comment