C# panel中添加pictureBox
pictureBoxpicture=newpictureBox();privatevoidpanel1_Paint(objectsender,PaintEventArgs...
pictureBox picture=new pictureBox();
private void panel1_Paint(object sender, PaintEventArgs e)
{
picture.Size = new System.Drawing.Size(512, 400);
panel1.Controls.Add(picture);
}
我用这个方法往panel里面添加了pictureBox
Graphics dc = picture.CreateGraphics();
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);//画刷
dc.FillEllipse(myBrush, new Rectangle(10,10,16,16));//画实心圆
用这个方法往picture里面添加了 实心圆 可生成项目后,我拉动panel的scroll,只要画出来的圆被拉出panel的显示范围 ,再来回来就会消失,为什么啊 展开
private void panel1_Paint(object sender, PaintEventArgs e)
{
picture.Size = new System.Drawing.Size(512, 400);
panel1.Controls.Add(picture);
}
我用这个方法往panel里面添加了pictureBox
Graphics dc = picture.CreateGraphics();
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);//画刷
dc.FillEllipse(myBrush, new Rectangle(10,10,16,16));//画实心圆
用这个方法往picture里面添加了 实心圆 可生成项目后,我拉动panel的scroll,只要画出来的圆被拉出panel的显示范围 ,再来回来就会消失,为什么啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询