在窗体上加了个listview控件
listView1.View = View.Details;如何在在某行某列加入我的字符串?
listView1.Items[n].SubItems[2].Text=lastTime.ToLongTimeString();总是这个错误
*******************
未处理的“System.ArgumentOutOfRangeException”类型的异常出现在 system.windows.forms.dll 中。其他信息: Specified argument was out of the range of valid values.
*******************但n没有超过行数啊?
listView1.View = View.Details;如何在在某行某列加入我的字符串?
listView1.Items[n].SubItems[2].Text=lastTime.ToLongTimeString();总是这个错误
*******************
未处理的“System.ArgumentOutOfRangeException”类型的异常出现在 system.windows.forms.dll 中。其他信息: Specified argument was out of the range of valid values.
*******************但n没有超过行数啊?
用listView1.Items[n].SubItems[2].Text
你至少有三列:
listView1.Columns.Count >= 3
listView1.Columns.Add(...);
listView1.Items[0].SubItems[2].Text就是正常的
如果两列,那么items[]中只能添0,或者1.
我印象中是这样
你试一下