Link to home
Start Free TrialLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

Help clarifying a textbook example project

I have been studying creating custom user controls, and am about to start the "Hands-on" programming example.
However, it's as if it's introducing a new feature that wasn't explained in the text.  Could someone clarify what is meant by changing the root namespace in the following:

"Create a Windows user control that ... <blah> <blah> <blah>
This control must make the data ... available to the form...
To share a Person structure between the control and the form, each project must be declared in the same namespace.  By default, each project is created in its own root namespace.  The easiest and best way to change this is to display the Project Properties dialog box and change the root namespace before building the project."

So - why exactly is changing the namespace necessary?  
And what exactly would one change it to?
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

They're basically saying that your UserControl and your Test Harness project should both be in the same namespace, presumably to simplify the example.

You can change it to whatever you want, just so long as they are the same. So, for example, you might have a line like:

    Namespace MyProject.UserControlSample

At the top of your UserControl class and the form in your test harness project.
Avatar of sirbounty

ASKER

Hmm - maybe my ignorance stems from the usage of 'namespace'.  What is it and how's it used in my project(s)?

Why would they need to share the same namespace and/or what would be the limitation(s) if they did not?
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx! :^)