static void OpenWindow() { HintWindow window = (HintWindow)GetWindow(typeof(HintWindow)); window.minSize = new Vector2(250, 200); window.Show(); }
protected override void Dispose(bool disposing) { if (hintWindow != null) { hintWindow.DestroyHandle(); } hintWindow = null; base.Dispose(disposing); }
private void ExecuteOpenHelpCommand(Window window) { if (window == null) { return; } var hint = new HintWindow { Owner = window }; hint.ShowDialog(); }
public void Show(Rectangle elementRect) { if (ownerForm == null) { return; } if (hintWindow == null) { hintWindow = new HintWindow(IntPtr.Zero, this); } Measure(ref elementRect); hintWindow.Show(elementRect.X, elementRect.Y, elementRect.Width, elementRect.Height); if (visible) { hintWindow.Redraw(); } visible = true; }
private void ExecuteOpenHintWindow(object arg) { if (!(arg is Button button)) { return; } MainWindow mainWindow = GetMainWindow(button); if (mainWindow == null) { return; } var hint = new HintWindow { Owner = mainWindow }; hint.ShowDialog(); }
/// <summary> /// Show hint with given relation to given position /// </summary> /// <param name="pos">Position to show in screen coordinates</param> /// <param name="includeCursor">Shift hint down to not intersect with cursor</param> public void Show(Point pos, bool includeCursor = false) { if (ownerForm == null) { return; } if (hintWindow == null) { hintWindow = new HintWindow(IntPtr.Zero, this); } Size size; Measure(ref pos, out size, includeCursor); hintWindow.Show(pos.X, pos.Y, size.Width, size.Height); if (visible) { hintWindow.Redraw(); } visible = true; }