B
Bob
Just new at this, Vs 2005 Vb.net
Created a new Windows control library User control project.
Only 1 file UserControl1.vb No code or object in it at all yet except what
was placed by default when created.
Public Class UserControl1
end class.
Can open file in designer and see user Control on which I can place other
controls OK.
Now I just add
Namespace AnyNamespace
Public Class UserControl1
End Class
end Namespace
So that's what I get. Immediately as I do that the icon for the vb module
UserControl1.vb changes to an ordinary vb code file icon and I can't open
that file in the designer any more. I get the following error in the
designer pane
One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.
The class UserControl1 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.
Hide
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager
manager)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
host)
as soon as I comment out the namespace lines, alls back to normal.
Can anyone tell me what I'm doing wrong?
Bob
Created a new Windows control library User control project.
Only 1 file UserControl1.vb No code or object in it at all yet except what
was placed by default when created.
Public Class UserControl1
end class.
Can open file in designer and see user Control on which I can place other
controls OK.
Now I just add
Namespace AnyNamespace
Public Class UserControl1
End Class
end Namespace
So that's what I get. Immediately as I do that the icon for the vb module
UserControl1.vb changes to an ordinary vb code file icon and I can't open
that file in the designer any more. I get the following error in the
designer pane
One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.
The class UserControl1 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.
Hide
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager
manager)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
host)
as soon as I comment out the namespace lines, alls back to normal.
Can anyone tell me what I'm doing wrong?
Bob