listview计算列和的问题
int i;
for (i = 0; i < listView2.Items.Count - 1; )
{
double s = 0;
ListViewItem a = listView2.Items[i];
s = s + Convert.ToDouble(a.SubItems[3].Text);
textBox7.Text = s.ToString();
}
有错误吗,为什么运行时死机?
------解决方案--------------------int i;
double s = 0;
for (i = 0; i < listView2.Items.Count - 1; i++)
{
ListViewItem a = listView2.Items[i];
s = s + Convert.ToDouble(a.SubItems[3].Text);
}
textBox7.Text = s.ToString();