public ImageAndTextLayout(Skybound.VisualTips.Rendering.VisualTipRenderer renderer, System.Drawing.Image image, System.Drawing.Font titleFont, string titleText, System.Drawing.Font textFont, string text, int width, int pad) { ImageBounds = System.Drawing.Rectangle.Empty; TextBounds = System.Drawing.Rectangle.Empty; ImageBounds.Size = image != null ? image.Size : System.Drawing.Size.Empty; if (image != null) { TextBounds.X = ImageBounds.Width + pad; TextBounds.Width = width - ImageBounds.Width - pad; } else { TextBounds.Width = width; } TextBounds.Height = 0; if (titleText.Length > 0) { System.Drawing.Size size1 = Skybound.Windows.Forms.TextRenderer.MeasureText(titleText, titleFont, new System.Drawing.Size(TextBounds.Width, 0), Skybound.Windows.Forms.TextFormatFlags.NoPrefix | Skybound.Windows.Forms.TextFormatFlags.WordBreak); int i = size1.Height; TitleTextHeight = size1.Height; TextBounds.Height = i; } if (text.Length > 0) { System.Drawing.Size size2 = Skybound.Windows.Forms.TextRenderer.MeasureText(text, textFont, new System.Drawing.Size(TextBounds.Width, 0), Skybound.Windows.Forms.TextFormatFlags.NoPrefix | Skybound.Windows.Forms.TextFormatFlags.WordBreak); TextBounds.Height += size2.Height; } Bounds = System.Drawing.Rectangle.FromLTRB(0, 0, width, System.Math.Max(ImageBounds.Bottom, TextBounds.Bottom)); }
protected override Skybound.VisualTips.Rendering.VisualTipLayout OnCreateLayout(Skybound.VisualTips.VisualTip tip) { Skybound.VisualTips.Rendering.VisualTipLayout visualTipLayout = base.OnCreateLayout(tip); visualTipLayout.OffsetWindow(4, 18); visualTipLayout.WindowBounds = System.Drawing.Rectangle.Inflate(visualTipLayout.WindowBounds, 4, 2); System.Drawing.Rectangle rectangle1 = visualTipLayout.ShadowBounds; System.Drawing.Rectangle rectangle2 = visualTipLayout.ShadowBounds; visualTipLayout.ShadowBounds = new System.Drawing.Rectangle(rectangle1.Location, rectangle2.Size + (new System.Drawing.Size(8, 32))); return visualTipLayout; }
protected override void OnTipPopup(Skybound.VisualTips.VisualTipEventArgs e) { try { if ((e.Tip != null) && System.String.IsNullOrEmpty(e.Tip.Title) && (e.Tip.TitleImage == null) && System.String.IsNullOrEmpty(e.Tip.Text) && (e.Tip.Image == null) && System.String.IsNullOrEmpty(e.Tip.FooterText) && (e.Tip.FooterImage == null)) { e.Cancel = true; return; } base.OnTipPopup(e); } catch (System.Exception) { } }
public static System.Drawing.Image FromIcon(Skybound.VisualTips.VisualTipNotifyIcon icon) { switch (icon) { case Skybound.VisualTips.VisualTipNotifyIcon.Error: return Skybound.VisualTips.VisualTipProvider.NotifyImages.Error; case Skybound.VisualTips.VisualTipNotifyIcon.Warning: return Skybound.VisualTips.VisualTipProvider.NotifyImages.Warning; case Skybound.VisualTips.VisualTipNotifyIcon.Information: return Skybound.VisualTips.VisualTipProvider.NotifyImages.Information; } return null; }
private System.Drawing.Point[] GetArrowPoints(Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle window) { System.Drawing.Rectangle rectangle = tip.GetRelativeToolArea(); int i = System.Math.Min(System.Math.Max(rectangle.X, window.X + 16), window.Right - 32); bool flag = i > (window.X + (window.Width / 2)); if (rectangle.Y <= 0) { System.Drawing.Point[] pointArr1 = new System.Drawing.Point[3]; pointArr1[0] = new System.Drawing.Point(i, window.Y); pointArr1[1] = new System.Drawing.Point(i + (flag ? 16 : 0), window.Y - 16); pointArr1[2] = new System.Drawing.Point(i + 16, window.Y); return pointArr1; } System.Drawing.Point[] pointArr2 = new System.Drawing.Point[3]; pointArr2[0] = new System.Drawing.Point(i + 16, window.Bottom - 1); pointArr2[1] = new System.Drawing.Point(i + (flag ? 16 : 0), window.Bottom - 1 + 16); pointArr2[2] = new System.Drawing.Point(i, window.Bottom - 1); return pointArr2; }
public static void ShowNotifyTip(System.Windows.Forms.Control control, string text, string title, Skybound.VisualTips.VisualTipNotifyIcon icon, Skybound.VisualTips.VisualTipDisplayOptions options) { if (control == null) throw new System.ArgumentNullException("control"); Skybound.VisualTips.VisualTipProvider.ShowNotifyTip(control, text, title, icon, options, control.Parent == null ? control.Bounds : control.Parent.RectangleToScreen(control.Bounds)); }
public static void SetExtender(System.Type controlType, Skybound.VisualTips.IVisualTipExtender extender) { if (controlType == null) throw new System.ArgumentNullException("controlType"); if (extender == null) throw new System.ArgumentNullException("extender"); Skybound.VisualTips.VisualTipProvider.Extenders[controlType] = extender; System.Type[] typeArr1 = extender.GetChildTypes(); if (typeArr1 != null) { System.Type[] typeArr2 = typeArr1; for (int i = 0; i < typeArr2.Length; i++) { System.Type type = typeArr2[i]; Skybound.VisualTips.VisualTipProvider.Extenders[type] = extender; } } }
public static void DrawText(System.Drawing.Graphics graphics, string text, System.Drawing.Font font, System.Drawing.Color foreColor, System.Drawing.Color backColor, System.Drawing.Rectangle bounds, Skybound.Windows.Forms.TextFormatFlags formatFlags) { if ((text == null) || (text.Length == 0) || (graphics == null) || (font == null) || bounds.Size == System.Drawing.Size.Empty || foreColor.Equals(System.Drawing.Color.Empty) || foreColor.Equals(System.Drawing.Color.Transparent)) return; System.IntPtr intPtr1 = graphics.GetHdc(); try { System.IntPtr intPtr2 = Skybound.Windows.Forms.TextRenderer.GetCachedFont(font); System.IntPtr intPtr3 = Skybound.Windows.Forms.TextRenderer.SelectObject(intPtr1, intPtr2); if (backColor.Equals(System.Drawing.Color.Empty) || backColor.Equals(System.Drawing.Color.Transparent)) { Skybound.Windows.Forms.TextRenderer.SetBkMode(intPtr1, 1); } else { Skybound.Windows.Forms.TextRenderer.SetBkMode(intPtr1, 2); Skybound.Windows.Forms.TextRenderer.SetBkColor(intPtr1, System.Drawing.ColorTranslator.ToWin32(backColor)); } int i = Skybound.Windows.Forms.TextRenderer.GetTextColor(intPtr1); Skybound.Windows.Forms.TextRenderer.SetTextColor(intPtr1, System.Drawing.ColorTranslator.ToWin32(foreColor)); Skybound.Windows.Forms.TextRenderer.RECT rect = new Skybound.Windows.Forms.TextRenderer.RECT(bounds); Skybound.Windows.Forms.TextRenderer.DrawText(intPtr1, text, text.Length, ref rect, (int)formatFlags); Skybound.Windows.Forms.TextRenderer.SetTextColor(intPtr1, i); Skybound.Windows.Forms.TextRenderer.SelectObject(intPtr1, intPtr3); } finally { graphics.ReleaseHdc(intPtr1); } }
public void ShowTip(Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle exclude) { ShowTip(tip, exclude, null, (Skybound.VisualTips.VisualTipDisplayOptions)tip.DisplayPosition); }
public void SetVisualTip(object component, Skybound.VisualTips.VisualTip visualTip) { Skybound.VisualTips.VisualTip visualTip1 = VisualTipMap[component] as Skybound.VisualTips.VisualTip; if (visualTip1 != null) visualTip1.SetProvider(null); if ((visualTip != null) && (visualTip.Provider != null)) visualTip.Provider.SetVisualTip(component, null); VisualTipMap[component] = visualTip; if (visualTip != null) { visualTip.SetProvider(this); Skybound.VisualTips.VisualTipProvider.UpdateTipTarget(visualTip, component); } }
public void Add(Skybound.VisualTips.VisualTipWindow window, System.Windows.Forms.Control control) { Skybound.VisualTips.VisualTipProvider.VisualTipWindowStack.WindowStackItem windowStackItem; UndisplayWindow(control); windowStackItem = new Skybound.VisualTips.VisualTipProvider.VisualTipWindowStack.WindowStackItem(); windowStackItem.Window = window; windowStackItem.Control = control; InnerList.Add(windowStackItem); }
public static void ShowNotifyTip(System.Windows.Forms.Control control, string text, string title, Skybound.VisualTips.VisualTipNotifyIcon icon) { Skybound.VisualTips.VisualTipProvider.ShowNotifyTip(control, text, title, icon, Skybound.VisualTips.VisualTipDisplayOptions.Default); }
public static void ShowNotifyTip(System.Windows.Forms.TextBox textBox, string text, string title, Skybound.VisualTips.VisualTipNotifyIcon icon, int charIndex) { if ((textBox == null) || textBox.IsDisposed) throw new System.ArgumentNullException("textBox", "textBox may not be null or disposed."); if ((charIndex < 0) || (charIndex > textBox.TextLength)) throw new System.ArgumentNullException("charIndex", "charIndex may not be less than zero or greater than the length of the TextBox text."); if (charIndex == textBox.TextLength) charIndex = System.Math.Max(charIndex - 1, 0); System.IntPtr intPtr = Skybound.VisualTips.VisualTipProvider.SendMessage(textBox.Handle, 214, new System.IntPtr(System.Math.Max(charIndex, 0)), System.IntPtr.Zero); int i = intPtr.ToInt32(); System.Drawing.Point point = textBox.PointToScreen(new System.Drawing.Point(i)); System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(point, new System.Drawing.Size(1, textBox.Font.Height)); Skybound.VisualTips.VisualTipProvider.ShowNotifyTip(textBox, text, title, icon, Skybound.VisualTips.VisualTipDisplayOptions.HideOnKeyPress | Skybound.VisualTips.VisualTipDisplayOptions.HideOnLostFocus, rectangle); }
protected override void OnDrawWindow(System.Windows.Forms.PaintEventArgs e, Skybound.VisualTips.VisualTip tip, Skybound.VisualTips.Rendering.VisualTipLayout layout) { System.Drawing.Rectangle rectangle = layout.WindowBounds; System.Drawing.Drawing2D.GraphicsPath graphicsPath = Skybound.VisualTips.Rendering.VisualTipRenderer.CreateRoundRectPath(rectangle, Skybound.VisualTips.Rendering.VisualTipRenderer.LayeredWindowsSupported ? 10 : 14, Skybound.VisualTips.Rendering.VisualTipRenderer.BorderCorners.All); using (System.Drawing.Brush brush1 = new System.Drawing.SolidBrush(BackColor)) { e.Graphics.FillPath(brush1, graphicsPath); } using (System.Drawing.Pen pen1 = new System.Drawing.Pen(BorderColor)) { if (Skybound.VisualTips.Rendering.VisualTipRenderer.LayeredWindowsSupported) e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; else pen1.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset; e.Graphics.DrawPath(pen1, graphicsPath); if (Skybound.VisualTips.Rendering.VisualTipRenderer.LayeredWindowsSupported) e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; System.Drawing.Point[] pointArr = GetArrowPoints(tip, rectangle); using (System.Drawing.Brush brush2 = new System.Drawing.SolidBrush(BackColor)) { e.Graphics.FillPolygon(brush2, pointArr); } using (System.Drawing.Pen pen2 = new System.Drawing.Pen(BackColor)) { e.Graphics.DrawPolygon(pen2, pointArr); } e.Graphics.DrawLines(pen1, pointArr); } }
protected override void OnDrawShadow(System.Windows.Forms.PaintEventArgs e, Skybound.VisualTips.VisualTip tip, Skybound.VisualTips.Rendering.VisualTipLayout layout) { if (HasShadow(tip) && System.Drawing.Rectangle.Intersect(layout.ShadowBounds, layout.WindowBounds) != layout.ShadowBounds) { System.Drawing.Rectangle rectangle = layout.ShadowBounds; rectangle.X += 4; rectangle.Width -= 4; rectangle.Y += 16; rectangle.Height -= 28; Skybound.VisualTips.Rendering.VisualTipRenderer.DrawDropShadow(e.Graphics, rectangle, 12, System.Drawing.Color.FromArgb(128, System.Drawing.Color.Black)); } }
private static extern int DrawText(System.IntPtr hdc, string lpStr, int nCount, ref Skybound.Windows.Forms.TextRenderer.RECT lpRect, int wFormat);
private static extern System.IntPtr CreateFontIndirect(ref Skybound.Windows.Forms.TextRenderer.LOGFONT lpLogFont);
public static System.Drawing.Size MeasureText(string text, System.Drawing.Font font, System.Drawing.Size extent, Skybound.Windows.Forms.TextFormatFlags formatFlags) { if ((text == null) || (text.Length == 0) || (font == null)) return System.Drawing.Size.Empty; if (extent == System.Drawing.Size.Empty) extent = new System.Drawing.Size(32767, 0); System.IntPtr intPtr1 = Skybound.Windows.Forms.TextRenderer.GetCachedFont(font); System.IntPtr intPtr2 = Skybound.Windows.Forms.TextRenderer.SelectObject(Skybound.Windows.Forms.TextRenderer.MeasureHdc, intPtr1); Skybound.Windows.Forms.TextRenderer.RECT rect = new Skybound.Windows.Forms.TextRenderer.RECT(new System.Drawing.Rectangle(0, 0, extent.Width, extent.Height)); Skybound.Windows.Forms.TextRenderer.DrawText(Skybound.Windows.Forms.TextRenderer.MeasureHdc, text, text.Length, ref rect, (int)formatFlags | 1024); Skybound.Windows.Forms.TextRenderer.SelectObject(Skybound.Windows.Forms.TextRenderer.MeasureHdc, intPtr2); return new System.Drawing.Size(rect.Right - rect.Left, rect.Bottom - rect.Top); }
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); }
protected override System.Drawing.Region OnCreateMaskRegion(Skybound.VisualTips.VisualTip tip, Skybound.VisualTips.Rendering.VisualTipLayout layout) { System.Drawing.Region region; System.Drawing.Rectangle rectangle = layout.WindowBounds; System.Drawing.Point[] pointArr1 = GetArrowPoints(tip, rectangle); System.Drawing.Point[] pointArr2 = new System.Drawing.Point[6]; if (pointArr1[0].Y == rectangle.Y) { pointArr1.CopyTo(pointArr2, 0); System.Drawing.Point point1 = new System.Drawing.Point(rectangle.X + 10, rectangle.Bottom); pointArr2[5] = new System.Drawing.Point(rectangle.X + 10, rectangle.Bottom); System.Drawing.Point point2 = point1; pointArr2[4] = point1; pointArr2[3] = point2; } else { System.Drawing.Point point3 = new System.Drawing.Point(rectangle.X + 10, rectangle.Y); pointArr2[2] = new System.Drawing.Point(rectangle.X + 10, rectangle.Y); System.Drawing.Point point4 = point3; pointArr2[1] = point3; pointArr2[0] = point4; pointArr1.CopyTo(pointArr2, 3); } using (System.Drawing.Drawing2D.GraphicsPath graphicsPath = new System.Drawing.Drawing2D.GraphicsPath()) { System.Drawing.Point[] pointArr3 = new System.Drawing.Point[26]; pointArr3[0] = new System.Drawing.Point(rectangle.X, rectangle.Y + 5); pointArr3[1] = new System.Drawing.Point(rectangle.X + 1, rectangle.Y + 3); pointArr3[2] = new System.Drawing.Point(rectangle.X + 2, rectangle.Y + 2); pointArr3[3] = new System.Drawing.Point(rectangle.X + 3, rectangle.Y + 1); pointArr3[4] = new System.Drawing.Point(rectangle.X + 5, rectangle.Y); pointArr3[5] = new System.Drawing.Point(pointArr2[0].X, pointArr2[0].Y); pointArr3[6] = new System.Drawing.Point(pointArr2[1].X, pointArr2[1].Y); pointArr3[7] = new System.Drawing.Point(pointArr2[1].X + 1, pointArr2[1].Y); pointArr3[8] = new System.Drawing.Point(pointArr2[2].X + 1, pointArr2[2].Y); pointArr3[9] = new System.Drawing.Point(rectangle.Right - 5, rectangle.Y); pointArr3[10] = new System.Drawing.Point(rectangle.Right - 2, rectangle.Y + 2); pointArr3[11] = new System.Drawing.Point(rectangle.Right - 1, rectangle.Y + 4); pointArr3[12] = new System.Drawing.Point(rectangle.Right, rectangle.Bottom - 7); pointArr3[13] = new System.Drawing.Point(rectangle.Right - 2, rectangle.Bottom - 3); pointArr3[14] = new System.Drawing.Point(rectangle.Right - 5, rectangle.Bottom - 1); pointArr3[15] = new System.Drawing.Point(rectangle.Right - 6, rectangle.Bottom); pointArr3[16] = new System.Drawing.Point(pointArr2[3].X + 1, pointArr2[3].Y); pointArr3[17] = new System.Drawing.Point(pointArr2[4].X + 1, pointArr2[4].Y); pointArr3[18] = new System.Drawing.Point(pointArr2[4].X, pointArr2[4].Y); pointArr3[19] = new System.Drawing.Point(pointArr2[5].X, pointArr2[5].Y); pointArr3[20] = new System.Drawing.Point(rectangle.X + 5, rectangle.Bottom); pointArr3[21] = new System.Drawing.Point(rectangle.X + 5, rectangle.Bottom - 1); pointArr3[22] = new System.Drawing.Point(rectangle.X + 4, rectangle.Bottom - 1); pointArr3[23] = new System.Drawing.Point(rectangle.X + 2, rectangle.Bottom - 3); pointArr3[24] = new System.Drawing.Point(rectangle.X + 1, rectangle.Bottom - 4); pointArr3[25] = new System.Drawing.Point(rectangle.X, rectangle.Bottom - 6); graphicsPath.AddLines(pointArr3); region = new System.Drawing.Region(graphicsPath); } return region; }
private static void UpdateTipTarget(Skybound.VisualTips.VisualTip tip, object component) { if (component == null) { tip.SetTarget(null, null); return; } if ((component is System.Windows.Forms.Control)) { tip.SetTarget(component as System.Windows.Forms.Control, null); return; } Skybound.VisualTips.IVisualTipExtender ivisualTipExtender = Skybound.VisualTips.VisualTipProvider.GetExtender(component.GetType()); if (ivisualTipExtender != null) { tip.SetTarget(ivisualTipExtender.GetParent(component) as System.Windows.Forms.Control, component); return; } tip.SetTarget(null, component); }
public Track(Skybound.Gecko.GeckoDocument gDoc) { this.gDoc = gDoc; }
public void Remove(Skybound.VisualTips.VisualTipWindow window) { for (int i = InnerList.Count - 1; i >= 0; i--) { if (((Skybound.VisualTips.VisualTipProvider.VisualTipWindowStack.WindowStackItem)InnerList[InnerList.Count - 1]).Window == window) { InnerList.RemoveAt(i); return; } } }
public void ShowTip(System.Windows.Forms.Control control, Skybound.VisualTips.VisualTipDisplayOptions options) { if (control == null) throw new System.ArgumentNullException("control"); ShowTip(control, options, control.Parent == null ? control.Bounds : control.Parent.RectangleToScreen(control.Bounds)); }
internal void OnUndisplay(Skybound.VisualTips.VisualTipWindow window) { if ((window == Skybound.VisualTips.VisualTipProvider.TrackedTipWindow) && (((Skybound.VisualTips.VisualTipProvider)Skybound.VisualTips.VisualTipTracker.TrackingProvider) == this)) Skybound.VisualTips.VisualTipTracker.TrackingProvider = null; _CurrentTip = null; CurrentControl = null; CurrentComponent = null; Skybound.VisualTips.VisualTipProvider.WindowStack.Remove(window); }
private void ShowTipCore(System.Windows.Forms.Control control, object component, Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle toolArea, Skybound.VisualTips.VisualTipDisplayOptions options) { if ((control != null) && control.InvokeRequired) { object[] objArr = new object[] { control, component, tip, toolArea, options }; control.BeginInvoke(new Skybound.VisualTips.VisualTipProvider.ShowTipCoreMethod(ShowTipCore), objArr); return; } bool flag = (options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnMouseLeave) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnMouseLeave; Skybound.VisualTips.VisualTipWindow visualTipWindow1 = flag ? Skybound.VisualTips.VisualTipProvider.TrackedTipWindow : CurrentTipWindow; if (visualTipWindow1 == null) { if (flag) { Skybound.VisualTips.VisualTipProvider.TrackedTipWindow = new Skybound.VisualTips.VisualTipWindow(); visualTipWindow1 = new Skybound.VisualTips.VisualTipWindow(); } else { Skybound.VisualTips.VisualTipWindow visualTipWindow2 = new Skybound.VisualTips.VisualTipWindow(); CurrentTipWindow = new Skybound.VisualTips.VisualTipWindow(); visualTipWindow1 = visualTipWindow2; } } if (visualTipWindow1.DisplayedTip != tip) { visualTipWindow1.Undisplay(); Skybound.VisualTips.VisualTipEventArgs visualTipEventArgs = new Skybound.VisualTips.VisualTipEventArgs(tip, component == null ? control : component); tip.SetProvider(this); Skybound.VisualTips.VisualTipProvider.UpdateTipTarget(tip, visualTipEventArgs.Instance); OnTipPopup(visualTipEventArgs); if (visualTipEventArgs.Cancel) { Skybound.VisualTips.VisualTipProvider.PreventDisplayTip = tip; return; } _CurrentTip = tip; CurrentControl = control; CurrentComponent = component; if (flag) Skybound.VisualTips.VisualTipTracker.TrackingProvider = this; Skybound.VisualTips.VisualTipProvider.WindowStack.Add(visualTipWindow1, control); visualTipWindow1.Display(this, tip, toolArea, options); return; } visualTipWindow1.SetToolArea(toolArea, options); }
public void ShowTip(System.Windows.Forms.Control control, Skybound.VisualTips.VisualTipDisplayOptions options, System.Drawing.Rectangle exclude) { if (control == null) throw new System.ArgumentNullException("control"); Skybound.VisualTips.VisualTip visualTip = GetEffectiveVisualTip(control, null); if (visualTip != null) ShowTip(visualTip, exclude, control, options); }
protected virtual void OnAccessKeyPressed(Skybound.VisualTips.VisualTipEventArgs e) { if (AccessKeyPressed != null) AccessKeyPressed(this, e); }
public void ShowTip(Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle exclude, System.Windows.Forms.Control sourceControl, Skybound.VisualTips.VisualTipDisplayOptions options) { if (tip == null) throw new System.ArgumentNullException("tip", "The tip parameter may not be null."); if ((sourceControl != null) && !sourceControl.IsDisposed) { if ((options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnKeyDown) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnKeyDown) sourceControl.KeyDown += new System.Windows.Forms.KeyEventHandler(ShowTipControl_KeyDown); if ((options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnKeyPress) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnKeyPress) sourceControl.KeyPress += new System.Windows.Forms.KeyPressEventHandler(ShowTipControl_KeyPress); if ((options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnLostFocus) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnLostFocus) sourceControl.LostFocus += new System.EventHandler(ShowTipControl_LostFocus); if ((options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnMouseDown) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnMouseDown) sourceControl.MouseDown += new System.Windows.Forms.MouseEventHandler(ShowTipControl_MouseDown); if ((options & Skybound.VisualTips.VisualTipDisplayOptions.HideOnTextChanged) == Skybound.VisualTips.VisualTipDisplayOptions.HideOnTextChanged) sourceControl.TextChanged += new System.EventHandler(ShowTipControl_TextChanged); sourceControl.HandleDestroyed += new System.EventHandler(ShowTipControl_HandleDestroyed); System.Windows.Forms.Form form = sourceControl.FindForm(); if (form != null) form.Deactivate += new System.EventHandler(ShowTipControl_Form_Deactivate); } ShowTipCore(sourceControl, null, tip, exclude, options); }
protected virtual void OnTipPopup(Skybound.VisualTips.VisualTipEventArgs e) { if (TipPopup != null) TipPopup(this, e); }