<p>How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls?</p>

<p><strong>Edit due to camainc's answer:</strong> I also have a constraint that I have to have all the code in a single project.</p>

<p><strong>Edit to finalise question:</strong> As I suspected it isn't possible to do what I required so camainc's answer is the nearest solution.</p>

[{'answer_id': 62817, 'author': 'camainc', 'author_id': 7232, 'author_profile': 'https://Stackoverflow.com/users/7232', 'pm_score': 2, 'selected': True, 'text': '<p>I\'m not sure if this is what you are asking, but this is how we do it.</p>\n\n<p>We namespace all of our projects in a consistent manner, user controls are no different. We also namespace using the project settings window, although you could do it through a combination of the project window and in code.</p>\n\n<p>Each solution gets a namespace like this:</p>\n\n<pre><code>[CompanyName].[SolutionName].[ProjectName]\n</code></pre>\n\n<p>So, our user controls are normally in a project called "Controls," which would have a namespace of:</p>\n\n<pre><code>OurCompany.ThisSolution.Controls\n</code></pre>\n\n<p>If we have controls that might span several different solutions, we just namespace it like so:</p>\n\n<pre><code>OurCompany.Common.Controls\n</code></pre>\n\n<p>Then, in our code we will import the library, or add the project to the solution.</p>\n\n<pre><code>Imports OurCompany\nImports OurCompany.Common\nImports OurCompany.Common.Controls\n</code></pre>\n\n<p>We also name the folders where the projects live the same as the namespace, down to but not including the company name (all solutions are assumed to be in the company namespace):</p>\n\n<p>\\Projects<br>\n\\Projects\\MySolution<br>\n\\Projects\\MySolution\\Controls</p>\n\n<p>-- or --</p>\n\n<p>\\Projects\\<br>\n\\Projects\\Common<br>\n\\Projects\\Common\\Assemblies<br>\n\\Projects\\Common\\Controls</p>\n\n<p>etc.</p>\n\n<p>Hope that helps...</p>\n'}, {'answer_id': 62957, 'author': 'Keithius', 'author_id': 5956, 'author_profile': 'https://Stackoverflow.com/users/5956', 'pm_score': 0, 'selected': False, 'text': "<p>Do you mean you want to be able to access user controls at runtime (in code) via </p>\n\n<blockquote>\n  <p><code>[ProjectNamespace].[YourSpecialNamespace].Controls</code></p>\n</blockquote>\n\n<p>rather than the default of </p>\n\n<blockquote>\n  <p><code>[ProjectNamespace].Controls</code></p>\n</blockquote>\n\n<p>? Because I don't believe that is possible. If I'm not mistaken, the <code>Controls</code> collection of your project/app is built-in by the framework - you can't change it. You can, as camainc noted, use the project settings window (or code) to place the controls themselves in a specific namespace thusly:</p>\n\n<blockquote>\n  <p><code>Namespace [YourSpecialNamespace]</code></p>\n  \n  <p><code>Public Class Form1</code></p>\n  \n  <p><code>[...]</code></p>\n  \n  <p><code>End Class</code></p>\n  \n  <p><code>End Namespace</code></p>\n</blockquote>\n\n<p>Of course, thinking about it some more, I suppose you could design and build your own <code>Controls</code> collection in your namespace - perhaps as a wrapper for the built-in one... </p>\n"}, {'answer_id': 3904409, 'author': 'Cody Gray', 'author_id': 366904, 'author_profile': 'https://Stackoverflow.com/users/366904', 'pm_score': 1, 'selected': False, 'text': '<p>If you don\'t want the controls to be in a separate project, you can just add the Namespace keyword to the top of the code file. For example, I\'ve done something like this in several projects:</p>\n\n<pre><code>Imports System.ComponentModel\n\nNamespace Controls\n   Friend Class FloatingSearchForm\n\n      \'Your code goes here...\n\n   End Class\nEnd Namespace\n</code></pre>\n\n<p>You will not be able to specify that the controls are in a different root namespace than that specified for the project they are a part of. VB will simply append whatever you specify for the namespace to the namespace specified in the project properties window. So, if your entire project is "AcmeCorporation.WidgetProgram" and you add "Namespace Controls" to the top of a control file, the control will be in the namespace "AcmeCorporation.WidgetProgram.Controls". It is not possible to make the control appear in the "AcmeCorporation.SomeOtherProgram.Controls" namespace.</p>\n\n<p>Also note that if you are using the designer to edit your controls, you need to add the Namespace keyword to the hidden partial class created by the designer. Click the "Show All Files" button in the solution explorer, then click the expand arrow next to your control. You should see a "*.Designer.vb" file listed. Add the Namespace to that file as well. The designer will respect this modification, and your project should now compile without error. Obviously, the namespace specified in the designer partial class must be the same one as that specified in your class file! For the above example:</p>\n\n<pre><code>Namespace Controls\n   &lt;Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()&gt; _\n   Partial Class FloatingSearchForm\n\n      \'Designer generated code\n\n   End Class\nEnd Namespace\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/62599', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6369/']