title: Group properties in a custom control
body: <p>In our IDE, for example, Visual Studio, if we display the properties of a System.Windows.Forms.Button control, we see some properties that expose anoter set of properties. For example: <em>FlatAppearance, Font, Location, Margin</em>, etcetera.</p>
  
  <p>I would like to do something similar in a custom control.</p>
  
  <p><strong>I know the code behind is wrong</strong>, but here is an example of what I´m trying to do:</p>
  
  <pre><code>Public Class StateOfMyCustomControl
  
      Public Enum EnumVisibility
          Visible
          NonVisible
      End Enum
  
      Public Enum EnumEventManagement
          Automatic
          Manual
      End Enum
  
      Private mAssociatedControl As MyCustomControl
      Private mVisibility As EnumVisibility
      Private mEventManagement As EnumEventManagement
  
      Public Sub New(ByVal AssociatedControl As MyCustomControl)
          mAssociatedControl = AssociatedControl
      End Sub
  
      Public Property Visibility() As EnumVisibility
          Get
              Return mVisibility
          End Get
          Set(ByVal value As EnumVisibility)
  
              mVisibility = value
  
              mAssociatedControl.Visible = False
              If mVisibility = EnumVisibility.Visible Then
                  mAssociatedControl.Visible = True
              End If
  
          End Set
      End Property
  
      Public Property EventManagement() As EnumEventManagement
          Get
              Return mEventManagement
          End Get
          Set(ByVal value As EnumEventManagement)
              mEventManagement = value
          End Set
      End Property
  
  End Class
  
  Public Class MyCustomControl
  
      ' ...
  
      Private mState As StateOfMyCustomControl
  
      Public Sub New()
          mState = New StateOfMyCustomControl(Me)
      End Sub
  
      Public Property State() As StateOfMyCustomControl
          Get
              Return mState
          End Get
          Set(ByVal value As StateOfMyCustomControl)
              mState = value
          End Set
      End Property
  
      ' ...
  
  End Class
  </code></pre>
  
  <p>In my IDE, in the properties window of my custom control, I would like to see my property <em>State</em>, with the possibility of display it to set the properties <em>Visibility</em> and <em>EventManagement</em>.</p>
  
  <p>Thanks very much</p>