随缘56 2018-06-10 03:31 采纳率: 0%
浏览 664
已结题

C#再用代码设置控件时出错了,该怎么解决

  whiteBox[numberWhite] = new PictureBox();
                    whiteBox[numberWhite].Size = new Size(20,20);
                    whiteBox[numberWhite].SizeMode = Zoom;
                    whiteBox[numberWhite].Location = pointWhite[numberWhite];
                    whiteBox[numberWhite].Image = Properties.Resources.白子;
                    whiteBox[numberWhite].BackColor = Color.Transparent;
                                          return whiteBox[numberWhite];
  • 写回答

4条回答 默认 最新

  • threenewbee 2018-06-10 03:37
    关注

    看你具体是编译错了,还是运行错了,具体错误的行是在哪里。
    比如whiteBox[numberWhite].SizeMode = Zoom; Zoom是什么类型的
    whiteBox[numberWhite].Location = pointWhite[numberWhite]; 下标有没有越界
    whiteBox[numberWhite].Image = Properties.Resources.白子; 资源有没有找到
    等等,都可能出错。

    你是在做五子棋么?有很多现成的
    https://blog.csdn.net/steveliu13/article/details/50573831
    https://www.jb51.net/article/133863.htm

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考