Moving a Windows Form into a specified namespace

  • Thread starter Thread starter Mark Hollander
  • Start date Start date
M

Mark Hollander

Hi All,

I would like to move a windows form from the root namespace of my project
into another namespace. (VS 2008)

When I add
Namespace REPORTING
Public Class SomeForm


End Class
End Namespace

All Hell seems to break loose.

Me.Label1.Text="Some text" gives the following error message in the IDE
'Label1' is not a member of SSN.REPORTING.SomeForm.

F1, F1 Somebody I need F1 in sorting this out
 
Hi All,

I would like to move a windows form from the root namespace of my project
into another namespace. (VS 2008)

When I add
Namespace REPORTING
Public Class SomeForm

End Class
End Namespace

All Hell seems to break loose.

Me.Label1.Text="Some text" gives the following error message in the IDE
'Label1' is not a member of SSN.REPORTING.SomeForm.

F1, F1 Somebody I need F1 in sorting this out

In VB, the Namespace keyword works in conjunction with the root
namespace. So if your root namespace is MyRootNamespace and you add
Namespace Reporting, the resulting namespace is
MyRootNamespace.Reporting. This is different than how it works in
C#.

In your case, make sure that you add the Namespace statement to all
parts of the form, including the other files as well, since your form
is likely spread across at least two files.

If you can't see the other forms in the solution explorer, click the
"Show All Files" button at the top of the solution explorer.

Chris
 
Back
Top