tinyabs,
The DefaultValue attribute is used by the designer to set the default
value.
In order to set the value yourself, you have to get the appropriate
class derived from TypeConverter. In order to do this, take the type
specified in the DefaultValue attribute, and look for the TypeConverter
attribute on that type. This should point to another type which has a
TypeConverter which you can then pass the string value to in order to create
the Size instance (which you will have to cast).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"tinyabs" <no****@me.co m> wrote in message
news:43******@n ews.starhub.net .sg...
Hi,
How do it set the default value of PopupSize?
[DefaultValue(ty peof(Size), "{Width=192,Hei ght=168}")]
public Size PopupSize
{
get { return FPopupSize; }
set { FPopupSize = value; }
}