private void HexView_OnTooltipOverlay(object sender, TooltipOverlayEventArgs args) { Tooltip.Visibility = Visibility.Visible; var s = (args.Entry.PropertyName != String.Empty) ? args.Entry.PropertyName + " - " : String.Empty; TooltipText.Text = s + args.Entry.ClassName; var top = (double)Rect1.GetValue(Canvas.TopProperty); top += top > 0 ? -1 * Tooltip.ActualHeight : Rect1.ActualHeight; Tooltip.SetValue(Canvas.TopProperty, top); Tooltip.SetValue(Canvas.LeftProperty, Rect1.GetValue(Canvas.LeftProperty)); }
public MainForm() { InitializeComponent(); JsonViewer.PropertyChanged += new PropertyChangedEventHandler(JsonViewer_PropertyChanged); try { var Salamander = Process.GetProcessesByName("salamand")[0]; Rect1 rect = new Rect1(); GetWindowRect(Salamander.MainWindowHandle, ref rect); this.Width = rect.Right - rect.Left; this.Height = rect.Bottom - rect.Top; this.Left = rect.Left; this.Top = rect.Top; } catch { } }
public override double Square() { return(Rect1.Square() * 2 + Rect2.Square() * 2 + Rect3.Square() * 2); }
public static extern bool GetWindowRect(IntPtr hwnd, ref Rect1 rectangle);