lundi 30 mars 2015

Add control to the parent control at runtime

I need to add a control added at runtime to the parent control (panel) I can set the properties of the object (PictureEdit) but how do i display it...add it to the parent control??? thank you



protected override void OnPaint(PaintEventArgs pe)
{
PictureEdit halfmoon = new PictureEdit();
halfmoon.Location = new Point(36, 3);
halfmoon.BorderStyle = BorderStyles.NoBorder;
halfmoon.Properties.SizeMode = PictureSizeMode.Squeeze;
halfmoon.Image = Properties.Resources.picture;
}

Aucun commentaire:

Enregistrer un commentaire