By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,931 Members | 1,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,931 IT Pros & Developers. It's quick & easy.

RegistryKey function

P: n/a
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


Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
R A,

Could you not just cast the result like this:

Size s = (Size) Key.GetValue (ClientSizeName);
--
John Wiese
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"R A" <ro****@hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
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

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.