본문 바로가기

코딩/C#

[코딩] 3

반응형
 
      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;
      }
반응형

'코딩 > C#' 카테고리의 다른 글

[C#] 스크롤 이벤트  (0) 2017.02.22
[코딩] Linefeed 방지  (0) 2017.02.17
[코딩] 2  (0) 2017.01.24
[코딩] 1  (0) 2017.01.24
[C#] 제네릭(Generics)  (0) 2016.03.18