indy500fan
asked on
I can convert a string to color, but how do I convert a color to string (to store it in XML)
Friends,
I am using an XML file to store user settings for my app. This method has worked great until I tried to deal with colors.
Now, I know I can convert a String to a color.. xmlAltRowColor = Color.FromName(xmlReader.R eadString)
But how do I convert a Color to a string?
Syntax Help Requested.
Thanks in advance!
Best Regards,
Eric
I am using an XML file to store user settings for my app. This method has worked great until I tried to deal with colors.
Now, I know I can convert a String to a color.. xmlAltRowColor = Color.FromName(xmlReader.R
But how do I convert a Color to a string?
Syntax Help Requested.
Thanks in advance!
Best Regards,
Eric
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jaime_olivares,
I am so sorry, I forgot all about this. I used your solution, but forgot to award points.
ptakja, yes I agree, and I implemented Jaime's solution, I just forgot to give Jaime points.
Regards,
Eric
I am so sorry, I forgot all about this. I used your solution, but forgot to award points.
ptakja, yes I agree, and I implemented Jaime's solution, I just forgot to give Jaime points.
Regards,
Eric
In fact, you can convert almost any object into a string using the .ToString method. I believe that the .ToString method is part of the System.Object class which is the base class for everything in .NET.
I say "almost" because some user-created classes may not be coded to support the .ToString method. But all .NET Framework classes do.
For example, take an Integer value x which has a value of 5
Dim x As Integer = 5
x.ToString will return "5"