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

给多个picturebox循环赋值
sbmp = IplImagePointerToBitmap(norm.Ptr);
(Controls["PictureBox" + i] as PictureBox).Image = sbmp;
sbmp已经是图片了
提示错误: 未将对象引用设置到对象的实例

------解决方案--------------------
(Controls["PictureBox" + i] as PictureBox) 这句有问题,,
Controls["PictureBox" + i] ??
------解决方案--------------------
Controls["PictureBox" + i]为NULL,或者不是PictureBox类型对象