In our IDE, such as Visual Studio, if we display the properties of the System.Windows.Forms.Button control, we see some properties that reveal the set of properties of the anoter. For example: FlatAppearance, Font, Location, Margin, etc.
I would like to do something like this in a user control.
I know that the code behind is wrong , but here is an example of what I'm trying to do:
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
In my IDE, in the properties window of my custom control, I would like to see my State property, with the ability to display it to set the Visibility and EventManagement properties.
Thank you very much
source share