如果我在VB.NET中创建一个新的类库项目,我可以创建子文件夹(a la C#),将WinForm对象添加到这些子文件夹,然后指定一个命名空间:
Namespace Sub1.Sub2
Public Class SomeForm
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
ProjectRootNamespace.Sub1.Sub2.SomeForm
,这很好。
但是,如果我在VB.NET中创建一个新的WinForms项目,并尝试相同的操作,则在设计器中会出现以下错误:
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.
有没有办法让窗体位于VB.NET WinForms应用程序的子命名空间中,而不是根命名空间中?