internal void SetProvider(Skybound.VisualTips.VisualTipProvider value) { RemoveEventHandlers(); _Provider = value; CurrentControl = null; CurrentComponent = null; }
public void Display(Skybound.VisualTips.VisualTipProvider provider, Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle toolArea, Skybound.VisualTips.VisualTipDisplayOptions options) { Provider = provider; _DisplayedTip = tip; _Options = options; RightToLeft = tip.RightToLeft; Skybound.VisualTips.Rendering.VisualTipLayout visualTipLayout = provider.Renderer.CreateLayout(tip); Size = visualTipLayout.GetSize(); Location = GetBestLocation(toolArea, Size, options); toolArea.Location = toolArea.Location - (new System.Drawing.Size(Location)); tip.SetRelativeToolArea(toolArea); if (IsLayeredWindow) { Animator.Stop(); using (System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(Width, Height)) using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap)) { provider.Renderer.Draw(new System.Windows.Forms.PaintEventArgs(graphics, new System.Drawing.Rectangle(0, 0, Width, Height)), tip, visualTipLayout); SetAlphaMask(bitmap, (byte)(Provider.Opacity * 255.0)); } } DisplayAnimate(); if (!IsLayeredWindow) { System.Drawing.Rectangle rectangle = visualTipLayout.WindowBounds; Width = rectangle.Width; Region = Provider.Renderer.CreateMaskRegion(tip, visualTipLayout); } }
public static void ShowNotifyTip(System.Windows.Forms.Control control, string text, string title, Skybound.VisualTips.VisualTipNotifyIcon icon, Skybound.VisualTips.VisualTipDisplayOptions options, System.Drawing.Rectangle exclude) { if (control == null) throw new System.ArgumentNullException("control"); if (control.IsDisposed) throw new System.ArgumentOutOfRangeException("control", control, "A tip may not be displayed for a control which has already been disposed."); if (Skybound.VisualTips.VisualTipProvider.NotifyProvider == null) { Skybound.VisualTips.VisualTipProvider.NotifyProvider = new Skybound.VisualTips.VisualTipProvider(); Skybound.VisualTips.VisualTipProvider.NotifyProvider.Renderer = new Skybound.VisualTips.Rendering.VisualTipBalloonRenderer(); } exclude.X = exclude.X - 12; Skybound.VisualTips.VisualTip visualTip = new Skybound.VisualTips.VisualTip(text, title); visualTip.TitleImage = Skybound.VisualTips.VisualTipProvider.NotifyImages.FromIcon(icon); Skybound.VisualTips.VisualTipProvider.NotifyProvider.ShowTip(visualTip, exclude, control, options); }