Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DefaultValue for Tab Control ItemSize
Message
From
12/10/2005 07:12:53
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01057791
Message ID:
01058256
Views:
12
Hi,

>To be honest I guessed :-) however of the top of my head - the TypeConverter has methods to check for the types its supports conversion from and to ie. CanConvertFrom(typeof(string)) or CanConvertTo(typeof(string)).
>
>I suppose you could do something like the following:-
>
>Size test = new Size();
>MessageBox.Show(TypeDescriptor.GetConverter(test).ConvertToString(test));
>
>Which should display the string to use, or you could do something like this:-
>
>foreach(Color c in TypeDescriptor.GetConverter(typeof(Color)).GetStandardValues())
>{
>   MessageBox.Show(TypeDescriptor.GetConverter(c).ConvertToString(c));
>}
>
Neat. I found the second approach but your first idea was one I hadn't thought of. Sure beats banging away with TypeConverter.IsValid() which was my idea !!

Regards,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform