我想清除我的Windows RT應用程序中的列表框項目。要添加的項目,我用:從列表框中刪除項目會導致災難性故障?
List<string> list1;
...
foreach(string s in list1.Items)
{
listBox1.Items.Add(s);
}
清除的項目,我使用的:如果我嘗試使用
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
:
listBox1.Items.Clear();
然而,這將引發此異常:
int at = 0;
while (at < listBox1.Items.Count)
{
listBox1.Items.RemoveAt(at);
at += 1;
}
我在R處得到相同的異常emoveAt方法。
很抱歉,但沒有列出''包含'Items'在所有的定義? –