public static void show_tooltip(int?width = null, int?height = null) { try { if (_tltp == null) { _tltp = new frm_tooltip(); } Point p = Cursor.Position; _tltp.Top = p.Y - 8; if (_tltp.Bottom > Screen.PrimaryScreen.Bounds.Bottom) { _tltp.Top -= _tltp.Bottom - Screen.PrimaryScreen.Bounds.Bottom; } _tltp.Left = p.X - 8; if (_tltp.Right > Screen.PrimaryScreen.Bounds.Right) { _tltp.Left -= _tltp.Right - Screen.PrimaryScreen.Bounds.Right; } _tltp.TopMost = true; _tltp.Width = width.HasValue ? width.Value : 350; _tltp.Height = height.HasValue ? height.Value : 350; _tltp.Show(); } catch { } }
protected static void show_tooltip(string html, int width, int height, base_interop for_scripting = null) { try { if (_tltp != null) { hide_tooltip(); } _tltp = new frm_tooltip(html, for_scripting); Point p = Cursor.Position; _tltp.Top = p.Y - 5; if (_tltp.Bottom > Screen.PrimaryScreen.Bounds.Bottom) { _tltp.Top -= _tltp.Bottom - Screen.PrimaryScreen.Bounds.Bottom; } _tltp.Left = p.X - 5; if (_tltp.Right > Screen.PrimaryScreen.Bounds.Right) { _tltp.Left -= _tltp.Right - Screen.PrimaryScreen.Bounds.Right; } _tltp.TopMost = true; _tltp.Width = width; _tltp.Height = height; _tltp.Show(); } catch { } }