<p>I have a usercontrol that has several public properties.  These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category.  Except two of the properties which are enumerations don't show up correctly.</p>

<p>The first on uses the following enum:</p>

<pre><code>public enum VerticalControlAlign
{
    Center,
    Top,
    Bottom
}
</code></pre>

<p>This does not show up in the designer <em>at all.</em></p>

<p>The second uses this enum:</p>

<pre><code>public enum AutoSizeMode
{
    None,
    KeepInControl
}
</code></pre>

<p>This one shows up, but the designer seems to think it's a bool and only shows True and False.  And when you build a project using the controls it will say that it can't convert type bool to AutoSizeMode.</p>

<p>Also, these enums are declared globably to the Namespace, so they are accessible everywhere.</p>

<p>Any ideas?</p>

[{'answer_id': 64175, 'author': 'Mark Ingram', 'author_id': 986, 'author_profile': 'https://Stackoverflow.com/users/986', 'pm_score': 1, 'selected': True, 'text': '<p>For starters, the second enum, AutoSizeMode is declared in System.Windows.Forms. So that might cause the designer some issues.</p>\n\n<p>Secondly, you might find the following page on MSDN useful:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/tk67c2t8.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/tk67c2t8.aspx</a></p>\n'}, {'answer_id': 64188, 'author': 'Thunder3', 'author_id': 2832, 'author_profile': 'https://Stackoverflow.com/users/2832', 'pm_score': 0, 'selected': False, 'text': '<p>Some things to try (designer mode in VS2005 I have found to be somewhat flaky):</p>\n\n<ol>\n<li>Open your web.config and add: <code>batch="false"</code> to your <code>&lt;compilation&gt;</code> tag.</li>\n<li><p>Try setting defaults to your enums:</p>\n\n<pre><code>public enum VerticalControlAlign\n{\n    Center = 0,\n    Top = 1,\n    Bottom = 2\n}\n</code></pre></li>\n</ol>\n'}, {'answer_id': 64210, 'author': 'Craig Eddy', 'author_id': 5557, 'author_profile': 'https://Stackoverflow.com/users/5557', 'pm_score': 0, 'selected': False, 'text': '<p>You do not need to make your enums global in order for them to be visible in the designer.</p>\n\n<p>Clarify please: </p>\n\n<ol>\n<li>if you add another value to your AutoSizeMode enum, does it still appear as a boolean? </li>\n<li>If (instead) you change the name of enum, does it still appear as a boolean?</li>\n</ol>\n'}, {'answer_id': 64326, 'author': 'Statement', 'author_id': 2166173, 'author_profile': 'https://Stackoverflow.com/users/2166173', 'pm_score': 2, 'selected': False, 'text': '<p>I made a little test with your problem (I\'m not sure if I understood it correctly), and these properties shows up in the designer correctly, and all enums are shown appropriately. If this isn\'t what you\'re looking for, then please explain yourself further. </p>\n\n<p>Don\'t get hang up on the _Ugly part thrown in there. I just used it for a quick test.</p>\n\n<pre><code>using System.ComponentModel;\nusing System.Windows.Forms;\n\nnamespace SampleApplication\n{\n    public partial class CustomUserControl : UserControl\n    {\n        public CustomUserControl()\n        {\n            InitializeComponent();\n        }\n\n        /// &lt;summary&gt;\n        /// We\'re hiding AutoSizeMode in UserControl here.\n        /// &lt;/summary&gt;\n        public new enum AutoSizeMode { None, KeepInControl }\n        public enum VerticalControlAlign { Center, Top, Bottom }\n\n        /// &lt;summary&gt;\n        /// Note that you cannot have a property  \n        /// called VerticalControlAlign if it is   \n        /// already defined in the scope.\n        /// &lt;/summary&gt;\n        [DisplayName("VerticalControlAlign")]\n        [Category("stackoverflow.com")]\n        [Description("Sets the vertical control align")]\n        public VerticalControlAlign VerticalControlAlign_Ugly\n        {\n            get { return m_align; }\n            set { m_align = value; }\n        }\n        private VerticalControlAlign m_align;        \n\n        /// &lt;summary&gt;\n        /// Note that you cannot have a property  \n        /// called AutoSizeMode if it is   \n        /// already defined in the scope.\n        /// &lt;/summary&gt;\n        [DisplayName("AutoSizeMode")]\n        [Category("stackoverflow.com")]\n        [Description("Sets the auto size mode")]\n        public AutoSizeMode AutoSizeMode_Ugly\n        {\n            get { return m_autoSize; }\n            set { m_autoSize = value; }\n        }\n        private AutoSizeMode m_autoSize;    \n    }\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/64139', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/194/']