1问题
首先面板控件的pnlData_Paint(object sender, PaintEventArgs e)中是
 以鼠标移动取了坐标而用DrawLine画了四线,刚好成十字形
那变量是从鼠标移动事件中赋值
二次作图
 private void btnCurveMake_Click(object sender, EventArgs e)
        {
            Bitmap   memBitmap   =   new   Bitmap(this.pnlData.Width,this.pnlData.Height);
            Graphics g = Graphics.FromImage(memBitmap);
            this.drawTupu(g);
            pnlData.BackgroundImage = memBitmap;
            
        }
drawTupu()方法画了图谱
为了十字坐标能随着鼠标移动而动,那么用了 pnlData.Refresh();
可是这第二次的图不要刷新,而且当十字中心点在图谱上要读数

解决方案 »

  1.   

    最简单的方法就是,把面板控件,换成pictureBox
      

  2.   

    你是不是要做CAD哪种十字线啊!
    public void MouseEnvents(MouseEventArgs e)
    {
      if (e.X != currentPoint.X  | | e.Y != currentPoint.Y) 
         { 
            currentPoint = new Point(e.X, e.Y); 
            this.Invalidate(true);
         }
    }
    public void Piants(Pen pen1,Pen pen2,PaintEventArgs e)
    {
       e.Graphics.DrawLine(pen1, 0, currentPoint.Y, this.Width, currentPoint.Y);    //绘制横线 
       e.Graphics.DrawLine(pen2, currentPoint.X, 0, currentPoint.X, this.Height);  //会制纵线 
    }////调用
    private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) 
    {
        MouseEnvents(e);
        this.Invalidate(true);
    }
    protected override void OnPaint(PaintEventArgs e) 
    {
        Piants(pen,pen,e);
    }
      

  3.   

     C# code
    这个标记就值,虽然不是我要的答案