动态生成自定义控件问题

No_what_cant No_what_cant 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我自定义的控件名叫 userControl1

public void load() {
this.SuspendLayout();
UserControl uc;
int x = 34;
int y = 24;
for (int i = 0; i <= 3; i++)
{

uc = new userControl1(); 这里会报错 提示 未能找到类型或者命名空间名称userControl1 为什么吗啊
uc.Size = new Size(550, 84);
x = x + 50;
uc.Location = new Point(x, y);
uc.Name = uc + i.ToString();
this.Controls.Add(uc);

}
this.ResumeLayout();
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
No_what_cant
C# 111,129 成员 642,540 内容