코딩/C#

[코딩] 3

버딩 2017. 1. 24. 14:22
반응형
 
      var obj = sender as TextBox;

      int left, right, bottom, top;
      var curserPos = System.Windows.Forms.Control.MousePosition;
      curserPos = this.PointToClient(curserPos);

      left = obj.Location.X;
      right = obj.Location.X + obj.Size.Width;
      bottom = obj.Location.Y + obj.Size.Height;
      top = obj.Location.Y;

      if (left < curserPos.X && right > curserPos.X && bottom < curserPos.Y && top > curserPos.Y)
            return;

      if (textBox1.Visible == true)
      {
            textBox1.Visible = false;
      }
반응형