Greetings to everyone!!!
As the title says, I would like to create a custom property for a UserControl that will include the Right and the Left values only from Padding property. This is an example of my code as it is now... I had to separate it into two different values. So, I want to do the same thing in one custom property, using the Padding property of my UserControl, but I want only Right and Left as available options.
If I am not wrong, after a short research on the web I realized that it should have to do with this TypeConverter. My problem is that I don't know how to set all this... Any kind of help would be really appreciated!!! Thank you in advance!!!Code:Private Const _DefaultSpace As Integer = 20 <Category("Extra Properties")> <DisplayName("LeftSpace")> <DefaultValue(_DefaultSpace)> Public Property LeftSpace As Integer Get Return MyUserConterol.Padding.Left End Get Set(ByVal value As Integer) MyUserConterol.Padding = New Padding(value, 0, 0, 0) End Set End Property <Category("Extra Properties")> <DisplayName("RightSpace")> <DefaultValue(_DefaultSpace)> Public Property RightSpace As Integer Get Return MyUserConterol.Padding.Right End Get Set(ByVal value As Integer) MyUserConterol.Padding = New Padding(0, 0, value, 0) End Set End Property





Reply With Quote
