private void HoverTimer_Tick(object sender, EventArgs e) { // if mouse in same block at same position for 5 ticks (2,5 seconds) display tool tip, else hide tool tip if (!Cursor.Position.Equals(HoverPos)) { HoverTicks = 0; HoverPos = new Point(0, 0); HoverBlock = null; HoverText = null; HoverTip.Hide(this); return; } if (HoverTicks < 1) { HoverTicks++; return; } if (HoverText == null && HoverBlock != null) { HoverText = HoverBlock.GetHoverText(); HoverTip.Show(HoverText, this, PointToClient(Cursor.Position)); } }
public void CursorUpdate(BlockRow block) { // test block because control can scroll without mouse moving if (Cursor.Position.Equals(HoverPos) && block == HoverBlock) { return; } HoverTicks = 0; HoverPos = Cursor.Position; HoverBlock = block; HoverText = null; HoverTip.Hide(this); }
private void HoverTimer_Tick(object sender, EventArgs e) { // if mouse in same block at same position for 5 ticks (2,5 seconds) display tool tip, else hide tool tip if ( !Cursor.Position.Equals(HoverPos) ) { HoverTicks = 0; HoverPos = new Point(0, 0); HoverBlock = null; HoverText = null; HoverTip.Hide(this); return; } if (HoverTicks < 1) { HoverTicks++; return; } if (HoverText == null && HoverBlock != null) { HoverText = HoverBlock.GetHoverText(); HoverTip.Show(HoverText, this, PointToClient(Cursor.Position)); } }
public void CursorUpdate(BlockRow block) { // test block because control can scroll without mouse moving if (Cursor.Position.Equals(HoverPos) && block == HoverBlock) return; HoverTicks = 0; HoverPos = Cursor.Position; HoverBlock = block; HoverText = null; HoverTip.Hide(this); }