RegistryKey function

R

R A

Hi

I write the registry value using the following:
Size size = new Size (100, 500);

Key.SetValue (ClientSizeName, size);

How can I retreive the value back to a Size type?

When I use

System.Type t = Key.GetValue (ClientSizeName).GetType ();

It comes back as a string, and thats ok because thats how it gets stored in
the registry. I wonder if there is a way to get it back as a Size type, or
do I have to manipulate the string?

Thanks,

Ronen
 
J

John Wiese [MS]

R A,

Could you not just cast the result like this:

Size s = (Size) Key.GetValue (ClientSizeName);
 

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