我用了
public void AddMyControls(int pos_width, int pos_height,string text,string name)
{
UserControl1 CheckBox1 = new UserControl1();
CheckBox1.Name = "chkbox" + name;
CheckBox1.Text = text;
CheckBox1.Location = new Point(48 + pos_width, 44 + pos_height);
CheckBox1.Size = new Size(104, 16);
Controls.Add(CheckBox1); MessageBox.Show(CheckBox1.Name.ToString()); }
这个代码用户控件显示不了
代码都是对的我直接把它拖到窗体上是可以的
public void AddMyControls(int pos_width, int pos_height,string text,string name)
{
UserControl1 CheckBox1 = new UserControl1();
CheckBox1.Name = "chkbox" + name;
CheckBox1.Text = text;
CheckBox1.Location = new Point(48 + pos_width, 44 + pos_height);
CheckBox1.Size = new Size(104, 16);
Controls.Add(CheckBox1); MessageBox.Show(CheckBox1.Name.ToString()); }
这个代码用户控件显示不了
代码都是对的我直接把它拖到窗体上是可以的
我 遇到个问题,我新建了一个用户控件,我现在想在界面上弹出这个控件,该怎么写啊?