private Point startpoint;//全局变量鼠标按下点
        private void pictureBox9_MouseDown(object sender, MouseEventArgs e)
        {
            Pen mypen = new Pen(Color.Red, 6);//画笔
            Point pShebei = new Point(0, 0);
            Graphics g = pictureBox9.CreateGraphics();//画图
            Brush redBrush = Brushes.Red;
            Font songti = new Font("宋体", 14);            startpoint.X = MousePosition.X -  4 - 202;
            startpoint.Y = MousePosition.Y -  28 - 45;
            int realheng = MousePosition.X -  - 4 - 202;
            int realshu = MousePosition.Y - 28 - 45;
            g.DrawString("" + "▼" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 4), new Size(50, 50)));

解决方案 »

  1.   

    减的那些数字是因为左边有tabcontrol
      

  2.   


     private Point startpoint;//全局变量鼠标按下点
     private Bitmap memoryBuffer;
     
    private void 窗体_Load事件:
           memoryBuffer=new Bitmap(pictureBox9.Width,pictureBox9.Height);private void pictureBox9_MouseDown(object sender, MouseEventArgs e)
    {
           Pen mypen = new Pen(Color.Red, 6);//画笔
           Point pShebei = new Point(0, 0);
           //Graphics g = pictureBox9.CreateGraphics();//画图
                
           Graphics g=Graphcis.FromImage(memoryBuffer);
     
           Brush redBrush = Brushes.Red;
           Font songti = new Font("宋体", 14);       startpoint.X = MousePosition.X -  4 - 202;
           startpoint.Y = MousePosition.Y -  28 - 45;
           int realheng = MousePosition.X -  - 4 - 202;
           int realshu = MousePosition.Y - 28 - 45;
           g.DrawString("" + "▼" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 4), new Size(50, 50)));        pictureBox9.Image=memoryBuffer;
            g.Dispose();
            songti.Dispose();}
      

  3.   

    在有图片上的pbox...private void 窗体_Load事件:
           memoryBuffer=pictureBox9.Image;
      

  4.   

    Graphics g=Graphcis.FromImage(PictureBox1.Image);
    ....
      

  5.   

    ข้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้ = =OnPaint里面重绘 ข้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้ 
      

  6.   

    Graphics g= Graphcis.FromImage(memoryBuffer);这一段代码显示当前上下文没有名称Graphics