显示对应于combobx的值 [英] displaye values corresponding to combobx

查看:91
本文介绍了显示对应于combobx的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件,里面有这样的内容

a,b,

c,d,

e,f,

g,h,



现在我已经通过streamreader读取文件后将ace和g添加到组合框中,然后拆分字符串。现在,当我选择一个组合框时,相应的b值应该同样显示在文本框上,如果我点击gh shuld就会显示在文本框上。

i have a file which have content like this
a ,b,
c ,d,
e ,f,
g ,h,

now i have added a c e and g to the combobox after reading file by streamreader and then split the string. Now when i select a in combobox corresponding b value should be displayed on textbox likewise if i click on g h shuld be displayed on textbox.

推荐答案

得到了答案顺便说一句,我自己就是这样的。



got the answer myself thnk you by the way

// MessageBox.Show(i.ToString());
            int count = 0;
            int splitcount = split.Length / 2;
            for (int i = 0; i < split.Length; i++)
            {
                count++;
             
                    if (i == ind)
                    {
                        textBox1.Text = split[i + 1*count];
                    }
            }


这篇关于显示对应于combobx的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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