Moving a Windows Form into a specified namespace

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
 
C

Chris Dunaway

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
 
M

Mark Hollander

Thank you.
It takes a bit of getting used to when one comes from 2003 background
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top