c# - assign string from list -


I've created a list with several options, we call a different color for each character. String A = "#FFB97FC 9"; String b = "#ff 9bcc 50"; // etc. String Answer 1 = Options. Answer 1; AnswerRectangle.Fill = GetColorFromHexa (answer1);

We now say that options.Answer1 = A .

I want to code answerCectangle # FFB97FC 9

How can I get it?

Note: Why not make a dictionary with the answer1 = # FFB97FC 9

     

glossary & lt; String, string & gt; Color = new dictionary & lt; String, string & gt; (); Colour. Add ("A", "# FFB 97F 9"); Colors.Add ("B", "# FF9BCC50");

and after that:

  answerRectangle.Fill = GetColorFromHexa (Color [answer1]);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -