日期:2014-05-17  浏览次数:21027 次

9乘9 的 picturebox, 判断左右相邻的图片是否一致,若一致则清空
9乘9 的 picturebox, 判断左右相邻的图片是否一致,若一致则清空(图片是从imagelist里边随机赋给picturebox的)
for (int i = 0; i < check.Length; i++)
            {
                List<Check> list = new List<Check>();
                if (i % 9 < 8 && list[i].Picturebox.Image == list[i + 1].Picturebox.Image== list[i + 2].Picturebox.Image)//索引超出范围。必须为非负值并小于集合大小。参数名: index这里没有超出啊,怎么回事。一整天就想这了
                {
                    list[i].Picturebox.Image = null;
                    list[i + 1].Picturebox.Image = null;
                }

------解决方案--------------------

这就是你不结贴的后果。