|
I defined a method to automatically add controls
public void AddMyControls (int pos_width, int pos_height, string text, string name)
{
PictureBox UserControl = new PictureBox ();
UserControl.Name = "PictureBox" + name;
UserControl.Location = new Point (40 + pos_width, 30 + pos_height);
UserControl.Size = new Size (124, 50);
this.Controls.Add (UserControl);
UserControl.Click + = new System.EventHandler (this.pictureBox_Click);
//MessageBox.Show (text.ToString ());
}
But the scope of this method is only for this.AddMyControls
this.tabPage1.AddMyControls is invalid
Is there any way to solve it |
|