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 the namespace:
Namespace Sub1.Sub2
Public Class SomeForm
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
It is allowed as ProjectRootNamespace.Sub1.Sub2.SomeFormthat is good.
However, if I create a new WinForms project in VB.NET and try to do the same, I get this error in the constructor:
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 the VB.NET WinForms application namespaces instead of the root namespace?
source
share