在一个pictureBox里生成一些竖直的连续排列的线条,高度随机 
高手快点给点代码吧

解决方案 »

  1.   

    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);
    }
    }
      

  2.   

    在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上面进行你说的操作的
      

  3.   

    已经搞定了 我想用线条来演示下各种排序算法
    把各种长度不一的线条按照从短到长的循序排整齐的显示在PictureBox中 
    有代码的贴代码啊  有想法的说想法:)