-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Rakesh Rajan
Message 1 in Discussion
Hi,
I have a Hashtable that stores all the values that my app uses. I add an element of
type Font into it like this:
RegistrySettings.Add("qteFont", new Font("Verdana", 12F));
And then store the value in the registry like:
MyReg.SetValue( someregkey, RegistrySettings[�qteFont�] );
Contrary to what I expected, the object got stored as a series of string properties;
like: �[Font: Name=Verdana, Size=12, Units=3, GdiCharSet=1, GdiVerticalFont=False]�
And Color objects gets stores as: �Color [A=255, R=255, G=153, B=0]�
When my app loads, I want to create a font object based on these values. So I load the
hashtable with all the values from the registry. And then I access the hashtable for
the values. Naturally, I tried using something like:
Font temp = (Font)RegistrySettings["qteFont"]; or
Color color = (Color)RegistrySettings["qteColor"];
I compile the project successfully, but the PropertyGridItem to which I bind this
object to shows �Specified cast is not valid.�
How will I develop objects from these string based values? - Is there any
straightforward method rather than parsing the string?
Lots of thanks,
Rakesh Rajan [ http://www.rakeshrajan.20m.com/ ]
Staying fit. It's about being happy! Check out the new mantra
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]