private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { System.Random rdm = new Random(0); for(int x = 0; x < 100; x++) { int y = rdm.Next(100); e.Graphics.DrawLine(new Pen(Color.Red),x,y,x,100); } }
在PictureBox的MSDN解释中: The picture that is displayed is determined by the Image property, which can be set at run time or at design time 所以,我想是不能够在PictureBox上面进行你说的操作的
{
System.Random rdm = new Random(0);
for(int x = 0; x < 100; x++)
{
int y = rdm.Next(100);
e.Graphics.DrawLine(new Pen(Color.Red),x,y,x,100);
}
}
The picture that is displayed is determined by the Image property, which can be set at run time or at design time
所以,我想是不能够在PictureBox上面进行你说的操作的
把各种长度不一的线条按照从短到长的循序排整齐的显示在PictureBox中
有代码的贴代码啊 有想法的说想法:)