Re: Converting Text to Default Colors in VB.NET
From: James Westgate (jameswestgate_at_nospam.nospam)
Date: 10/01/04
- Next message: James Westgate: "Re: How to make a paint brush tool with 'feathered' edges"
- Previous message: Teis Draiby: "How to make a paint brush tool with 'feathered' edges"
- In reply to: Terry: "Converting Text to Default Colors in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 1 Oct 2004 13:44:30 +0100
Terry,
Try the color.FromName static method. Obviously your xml colro scheme will
have to match the scheme defined but its pretty comprehensive
James
-- Create interactive diagrams and flowcharts with ERM Diagram at http://www.crainiate.net Take the ERM Tour at http://www.flowchartcontrol.com "Terry" <Terry@discussions.microsoft.com> wrote in message news:2F9C7E79-F287-4B7F-9EC5-03D5D924CC81@microsoft.com... >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: James Westgate: "Re: How to make a paint brush tool with 'feathered' edges"
- Previous message: Teis Draiby: "How to make a paint brush tool with 'feathered' edges"
- In reply to: Terry: "Converting Text to Default Colors in VB.NET"
- Messages sorted by: [ date ] [ thread ]