//to display my inventory array
for (int i = 0; i < arrayInventory[18]);
{
lsbInvetory.Items.Add(arrayInventory[18]);
}
此代码未显示错误,但不会显示在列表框中。
以下是数组列表框的代码
double[] arrayInventory = new double[] // declaring & initialized single array
{200, 50, 30, 25, 10, 10, 20, 14, 14, 10, 20, 15, 12, 20, 60, 25, 10, 10 };
答案 0 :(得分:0)
像这样改变
for (int i = 0; i < arrayInventory.Length; i++)
{
lsbInvetory.Items.Add(arrayInventory[i]);
}