If I create a new class library project in VB.NET, I can create subfolders (a la C#), add WinForm objects to these subfolders, and then specify a namespace:
Namespace Sub1.Sub2
Public Class SomeForm
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
This resolves as ProjectRootNamespace.Sub1.Sub2.SomeForm
, which is good.
However, if I create a new WinForms project in VB.NET, and attempt the same thing, I get this error in the designer:
The class SomeForm can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.
Is there a way to have forms in sub-namespaces of a VB.NET WinForms app instead of in the root namespace?