Ankit Agarwal

Ankit Agarwal

  • NA
  • 379
  • 253.4k

How to use dictionary for Keyboard key and display value?

Mar 27 2015 5:51 AM
Hello,
i am using this dictionary for input data in C# .net wpf application.
 
Dictionary<int, string> dic = new Dictionary<int, string>();
dic.Add(1, "E");
dic.Add(2, "G");
dic.Add(3, "$");
dic.Add(4, "/");
dic.Add(5, "!");
dic.Add(6, "P");
dic.Add(7, "*");
dic.Add(8, "@");
dic.Add(9, "Q");
dic.Add(0, "U");
 
But how can i use this dictionary?
When in enter 12 so then EG should be display in text box.
and when i enter 5 so ! should be display in textbox.
Total should be calculate like 12+5=17 (E*).
Please help me.
Thanks in Advance.
Ankit Agarwal
Software Engineer
 

Answers (2)