Custom Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a custom struct called ControlMargin which will have Left and Right. It is ame as that of Size which has Weidth and Height
Now I am using this struct to define a property called Margin which is og the type ControlMargin
But when i am going to the designer of my control i am not abl to see that "+" sign (It appears as ControlMargin(0,0) )as it appears when i use Size as a type of a property.Also my custom property is shown readOnly I am not able to change it

Can anybody help me implementing my custom property "ControlMargin" which is of type struct "Margin"......

Thanks in anticipation
Nilesh
 
You need a TypeConverter. I can't help you with the details though.
The source for SizeConverter might help. It's almost the same thing.
Download Reflector to take look at it
(http://www.aisto.com/roeder/dotnet/)

/claes

Nilesh Rade said:
I am having a custom struct called ControlMargin which will have Left and
Right. It is ame as that of Size which has Weidth and Height.
Now I am using this struct to define a property called Margin which is og the type ControlMargin.
But when i am going to the designer of my control i am not abl to see that
"+" sign (It appears as ControlMargin(0,0) )as it appears when i use Size as
a type of a property.Also my custom property is shown readOnly I am not able
to change it.
Can anybody help me implementing my custom property "ControlMargin" which
is of type struct "Margin".......
 
Hi Alok,
Can u explain me how can user this ExpandableObjectConverter Class to
make my Margin property work exactly like Size?
Can you please provide me with some sample code ....

Thanks in anticipation.

Nilesh
 
Back
Top