private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 4; i++)
{
int test = i * i;
listView1.Items.Add("key" + i.ToString(), test.ToString(), i);
}
}
private void button2_Click(object sender, EventArgs e)
{
for (int i = 0; i < 4; i++)
{
MessageBox.Show(listView1.Items["key" + i.ToString()].Text);
}
}
參考
http://zhidao.baidu.com/question/85025088
沒有留言:
張貼留言