Custom Property

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
 
C

Claes Bergefall

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".......
 
N

Nilesh Rade

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top