1. 首页
  2. 编程语言
  3. C#
  4. C#动态添加控件源代码

C#动态添加控件源代码

上传者: 2019-04-08 09:11:17上传 TXT文件 914B 热度 34次
在C#下,动态添加控件源代码,pic name = "image_" + i.ToString(); PictureBox pb = new PictureBox(); pb.Name = name; pb.Image = (Image)Properties.Resources.ResourceManager.GetObject(sImage); pb.Tag = "test"; this.Controls.Add(pb); pb .Width=23; pb.Height =23; int x = Convert.ToInt32( 80 + 27.85 * (i % 27)); int y=Convert.ToInt32(33 + 28 * (i / 27)); pb.Location = new System.Drawing.Point(x,y); .Width=23; pb.Height =23; int x = Convert.ToInt32( 80 + 27.85 * (i % 27)); int y=Convert.ToInt32(33 + 28 * (i / 27)); pb.Location = new System.Drawing.Point(x,y);
用户评论
码姐姐匿名网友 2019-04-08 09:11:17

写的很简单

码姐姐匿名网友 2019-04-08 09:11:17

额,就是啊,没有看明白,不过谢谢了

码姐姐匿名网友 2019-04-08 09:11:17

资源很简单,没什么东西。

码姐姐匿名网友 2019-04-08 09:11:17

没有看懂,代码没有注释唉