/// <summary> /// <para>Find a good location to hover</para> /// <para>If possible, try to locate the form on the top left border</para> /// </summary> public void FindGoodSpot() { if (this.IsDisposed) { return; } HtmlTextbox htmlTextBox = this.HtmlTextBox; if (htmlTextBox == null || htmlTextBox.FindForm() == null) { return; } Rectangle bounds = htmlTextBox.Bounds; Rectangle rctParent = htmlTextBox.Parent.RectangleToScreen(bounds); bool onTop = true; if (this.Height > rctParent.Top) { onTop = false; } this.Left = rctParent.Left; this.Top = onTop ? rctParent.Top - this.Height : rctParent.Bottom; }
public FrmToolbar(HtmlTextbox parent) { InitializeComponent(); this.HtmlTextBox = parent; this._theBrowser = parent.theBrowser; // Copy font items from parent this.tsbFont.Items.Clear(); this.tsbFont.Items.AddRange(this.HtmlTextBox.Fonts); this.AttachMouseOnChildren(); }