Someone Help...
I used VB2008 in this project of mine...
Here is what I did:
I created a Custom Class named it to "
CustomClass
". I created some properties for this class "
Num1
" and "
Num2
" they are both integers. The toSring() was overridden. I also implemented a Type Converter for this class some function were overridden "
CanConvertFrom, CanConvertTo, ConvertFrom, ConvertTo, GetStandardValuesSupported and GetStandardValues
".
I created a Custom Control named it to "CustomControl", Set CustomClass as its property.
Public Class CustomControl : Inherits Control
Private _sample As New CustomClass(1,2)
Public Property sample() as CustomClass
'Get here...
'Set here...
End Property
Enc Class
This is what it looked like. The PropertyGrid displays the Property I created.
-------------
sample | 1,2 |
-------------
Num1 | 1 |
Num2 | 2 |
-------------
All went fine but every time I set a different value to each property the values reset back to their defaults.