您好我正在尝试用数组填充一个简单的ListBox。我的代码;它会抛出此错误
错误1当前上下文中不存在名称“myArrayList”
public class Class1
{
public void FillArray()
{
int min = 1;
int max = 1000;
int[] testArray = new int[1000];
Random randNumber = new Random();
for (int i = 1; i < testArray.Length; i++)
{
testArray[i] = randNumber.Next(min, max);
}
foreach (int value in testArray)
{
myArrayList.ItemSource = testArray;
}
}
}