public void EnableLine(bool flag) { if (RectLeft != null) { RectLeft.EnableLine(this, flag); } if (RectRight != null) { RectRight.EnableLine(this, flag); } if (flag) { UIController.Instance.EnableLine(_uiLine); _uiLine.MouseLeftButtonUp -= UiLineOnMouseLeftButtonUp; } }
protected override void WndProc(ref Message message) { base.WndProc(ref message); if (message.Msg == 0x84) // WM_NCHITTEST { var cursor = this.PointToClient(Cursor.Position); if (TopLeft.Contains(cursor)) { message.Result = (IntPtr)HTTOPLEFT; } else if (TopRight.Contains(cursor)) { message.Result = (IntPtr)HTTOPRIGHT; } else if (BottomLeft.Contains(cursor)) { message.Result = (IntPtr)HTBOTTOMLEFT; } else if (BottomRight.Contains(cursor)) { message.Result = (IntPtr)HTBOTTOMRIGHT; } else if (RectTop.Contains(cursor)) { message.Result = (IntPtr)HTTOP; } else if (RectLeft.Contains(cursor)) { message.Result = (IntPtr)HTLEFT; } else if (RectRight.Contains(cursor)) { message.Result = (IntPtr)HTRIGHT; } else if (RectBottom.Contains(cursor)) { message.Result = (IntPtr)HTBOTTOM; } } }