Converting Text to Default Colors in VB.NET
From: Terry (Terry_at_discussions.microsoft.com)
Date: 09/30/04
- Next message: Sam Jost: "gdi+: bitmap.save keeps crashing - HELP!"
- Previous message: Dr Duck: "Re: GetThumbnailImage increases file size"
- Next in thread: James Westgate: "Re: Converting Text to Default Colors in VB.NET"
- Reply: James Westgate: "Re: Converting Text to Default Colors in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 11:35:09 -0700
I have an XML file that has settings for my app. Many of the settings
involve color (i.e. <BackColor>Red</BackColor>). The XML value is read into
a string, so I have a string called strBackColor with the value "Red". Now I
want to set the form to BackColor.Red. How do I do this without having a
giant SELECT like this...
SELECT CASE strBackColor
CASE "Red"
Me.BackColor = Backcolor.Red
CASE "Blue"
Me.BackColor = Backcolor.Red
...
END SELECT
Acually, I want it to be part of a global shared method that I can use
throughout my system, where I pass in a String and it returns the color..like
Me.BackColor = CStringToColor(strBackColor)
Thanks for your help,
Terry
- Next message: Sam Jost: "gdi+: bitmap.save keeps crashing - HELP!"
- Previous message: Dr Duck: "Re: GetThumbnailImage increases file size"
- Next in thread: James Westgate: "Re: Converting Text to Default Colors in VB.NET"
- Reply: James Westgate: "Re: Converting Text to Default Colors in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|