【发布时间】:2014-09-12 16:27:32
【问题描述】:
好的,我正在尝试通过我的按钮在哈希表中显示多个值。但它一直向我显示第一个值,而不是其他值。
public Form1()
{
InitializeComponent();
}
Hashtable Info = new Hashtable();
private void button1_Click(object sender, EventArgs e)
{
string a = textBox1.Text;
string b = textBox2.Text;
Info.Add(a,b);
label4.Text = a + " " + b;
}
private void button3_Click(object sender, EventArgs e)
{
foreach (DictionaryEntry DE in Info)
{
label4.Text = ""+ DE.Key +DE.Value; //this only shows the first added value. How do I show the remaining values?
}
}
【问题讨论】: