Adding controls at run-time in windows forms

Shreedar
Posted by Shreedar under Windows Forms category on | Points: 40 | Views : 788
We can add any control. Here am using PictureBox Control for adding in runtime.
Private Void Form1_Mousedown(Object Sender Args e)
{
PictureBox p=new PictureBox();
P.Image= new Bitmap("E:/flower");
P.SizeMode= PictureBoxSizeMode.AutoSIze;
P.Location= new Point(e.X, e.Y);
this.Controls.Add(P);
}

Comments or Responses

Login to post response