diff --git a/video/Controls/LabelTooltip.cs b/video/Controls/LabelTooltip.cs index 6d95ed45..b0d14d32 100644 --- a/video/Controls/LabelTooltip.cs +++ b/video/Controls/LabelTooltip.cs @@ -19,7 +19,14 @@ public void AttachTooltip(Control control, bool followCursor, Func<MouseEventArg Form form = control.FindForm(); System.Diagnostics.Debug.Assert(form != null); - Text = tooltipFunc(args); + string text = tooltipFunc(args); + + if (text == null){ + Visible = false; + return; + } + + Text = text; Point loc = form.PointToClient(control.Parent.PointToScreen(new Point(control.Location.X+(followCursor ? args.X : control.Width/2), 0))); loc.X = Math.Max(0, Math.Min(form.Width-Width, loc.X-Width/2)); diff --git a/video/FormPlayer.cs b/video/FormPlayer.cs index 58f4c9af..4335fd40 100644 --- a/video/FormPlayer.cs +++ b/video/FormPlayer.cs @@ -57,6 +57,10 @@ public FormPlayer(IntPtr handle, int volume, string url, string token){ trackBarVolume.Value = volume; // changes player volume too if non-default labelTooltip.AttachTooltip(progressSeek, true, args => { + if (args.X < 0 || args.Y < 0 || args.X >= progressSeek.Width || args.Y >= progressSeek.Height){ + return null; + } + IWMPMedia media = Player.currentMedia; int progress = (int)(media.duration*progressSeek.GetProgress(args.X));