예제 #1
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     base.OnMouseDown(e);
     if (this.area == Rectangle.Empty && e.Button == MouseButtons.Left)
     {
         this.area.Location = new Point(e.X, e.Y);
     }
     this.op    = new Point(e.X, e.Y);
     this.index = this.GetSelectedHandle(new Point(e.X, e.Y));
     this.SetCursor();
     draw = true;
     if (this.area.Contains(e.Location) && drawing)
     {
         sl = e.Location;
         md = true;
         RECT rect = new RECT();
         rect.left   = this.area.Left;
         rect.right  = this.area.Right;
         rect.top    = this.area.Top;
         rect.bottom = this.area.Bottom;
         WindowsAPI.ClipCursor(ref rect);
     }
     if (textBox1.Visible)
     {
         graphics = Graphics.FromImage(origin);
         graphics.DrawString(textBox1.Text, textBox1.Font, new SolidBrush(label9.BackColor), new RectangleF(new Point(textBox1.Location.X, textBox1.Location.Y + 2), textBox1.Size));
         graphics = Graphics.FromImage(img);
         graphics.DrawString(textBox1.Text, textBox1.Font, new SolidBrush(label9.BackColor), new RectangleF(new Point(textBox1.Location.X, textBox1.Location.Y + 2), textBox1.Size));
         graphics = this.CreateGraphics();
         graphics.DrawImage(img, new Point(0, 0));
         textBox1.Text    = "";
         textBox1.Visible = false;
         api.ReleaseCursor();
         fd = false;
     }
 }