protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (MouseState != MouseState.DOWN) { Cursor = Cursors.Default; CursorUpdate?.Invoke(this, Cursor); } if (AutoShow) { Hide(); } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (DesignMode) { return; } if (_drawerItemRects == null) { UpdateTabRects(); } Cursor previousCursor = Cursor; if (e.Location.X + this.Location.X < BORDER_WIDTH) { if (e.Location.Y > this.Height - BORDER_WIDTH) { Cursor = Cursors.SizeNESW; //Bottom Left } else { Cursor = Cursors.SizeWE; //Left } } else if (e.Location.Y > this.Height - BORDER_WIDTH) { Cursor = Cursors.SizeNS; //Bottom } else { if (e.Location.Y < _drawerItemRects[_drawerItemRects.Count - 1].Bottom && (e.Location.X + this.Location.X) >= BORDER_WIDTH) { Cursor = Cursors.Hand; } else { Cursor = Cursors.Default; } } if (previousCursor != Cursor) { CursorUpdate?.Invoke(this, Cursor); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (MouseState != MouseState.DOWN) { Cursor = Cursors.Default; CursorUpdate?.Invoke(this, Cursor); } if (AutoShow) { if (DisplayRectangle.Contains(Control.MousePosition) == false) { Hide(); } } }
protected override void OnMouseMove(MouseEventArgs e) { if (DesignMode) { return; } if (e.Button == MouseButtons.Left && e.Y != _lastMouseY && (Location.Y < 0 || Height < (8 + drawerItemHeight) * _drawerItemRects.Count)) { int diff = e.Y - _lastMouseY; if (diff > 0) { if (Location.Y < 0) { Location = new Point(Location.X, Location.Y + diff > 0 ? 0 : Location.Y + diff); Height = Parent.Height + Math.Abs(Location.Y); } } else { if (Height < (8 + drawerItemHeight) * _drawerItemRects.Count) { Location = new Point(Location.X, Location.Y + diff); Height = Parent.Height + Math.Abs(Location.Y); } } //return; } base.OnMouseMove(e); if (_drawerItemRects == null) { UpdateTabRects(); } Cursor previousCursor = Cursor; if (e.Location.X + this.Location.X < BORDER_WIDTH) { if (e.Location.Y > this.Height - BORDER_WIDTH) { Cursor = Cursors.SizeNESW; //Bottom Left } else { Cursor = Cursors.SizeWE; //Left } } else if (e.Location.Y > this.Height - BORDER_WIDTH) { Cursor = Cursors.SizeNS; //Bottom } else { if (e.Location.Y < _drawerItemRects[_drawerItemRects.Count - 1].Bottom && (e.Location.X + this.Location.X) >= BORDER_WIDTH) { Cursor = Cursors.Hand; } else { Cursor = Cursors.Default; } } if (previousCursor != Cursor) { CursorUpdate?.Invoke(this, Cursor); } }