我需要在运行时添加一个控件添加到父控件(面板) 我可以设置对象的属性(PictureEdit),但我如何显示它...添加到父控件??? 谢谢
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;
}
答案 0 :(得分:0)
Panel_name.Controls.Add(halfmoon);