如何在我的c#.net WPF应用程序中使用我自己的字典用于文本框? [英] How to use my own dictionary for textboxs in my c# .net WPF applicaion?

查看:73
本文介绍了如何在我的c#.net WPF应用程序中使用我自己的字典用于文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



i我在C#.net wpf应用程序中使用此词典输入数据。



字典< 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 );





但我怎么能用这本字典?



当输入12时,那么EG应显示在文本框中。

,当我输入5时!应显示在文本框中。



总计应计算为12 + 5 = 17(E *)。



请帮帮我。



先谢谢。



Ankit Agarwal

软件工程师

解决方案

);
dic.Add( 4 /);
dic.Add( 5 );
dic.Add ( 6 P);
dic.Add( 7 * );
dic.Add( 8 @);
dic.Add( 9 Q);
dic.Add( 0 U );





但我怎么能用这本字典?



当输入12时,那么EG应显示在文本框中。

,当我输入5时!应显示在文本框中。



总计应计算为12 + 5 = 17(E *)。



请帮帮我。



先谢谢。



Ankit Agarwal

软件工程师


请阅读:

http:// www.dotnetperls.com/dictionary [ ^ ]

它还解释了如何获得密钥。值。


  public   partial   class  Window1:Window 
{
public Window1()
{
InitializeComponent();
dic.Add( 1 E );
dic.Add( 2 G );
dic.Add( 3

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

解决方案

"); 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


Please read this:
http://www.dotnetperls.com/dictionary[^]
It also explains how to get keys resp. values.


public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            dic.Add(1, "E");
            dic.Add(2, "G");
            dic.Add(3, "


这篇关于如何在我的c#.net WPF应用程序中使用我自己的字典用于文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆