private void CurrentTooltip_PaintBackground(object sender, PaintEventArgs e) { DerpedToolTipForm fffff = sender as DerpedToolTipForm; if (fffff != null) { this.BackgroundDraw?.Invoke(sender, new DrawToolTipEventArgs(e.Graphics, fffff, (System.Windows.Forms.Control)fffff.Tag, fffff.ClientRectangle, fffff.ExTooltipText, fffff.BackColor, fffff.ForeColor, fffff.Font)); } }
private void CloseCurrentTip() { if (this.currentTooltip != null) { this.currentTooltip.Close(); } this.currentTooltip = null; this.currentControl = null; }
private DerpedToolTipForm SetupAnotherTip() { var result = new DerpedToolTipForm(this.UseFading); result.Paint += CurrentTooltip_Paint; //result.PaintBackground += CurrentTooltip_PaintBackground; result.FormBorderStyle = FormBorderStyle.None; result.BackColor = this.FormColor; result.Font = this.Font; result.StartPosition = FormStartPosition.Manual; result.ForeColor = this.ForeColor; result.FormClosed += Result_FormClosed; return(result); }
private void CurrentTooltip_Paint(object sender, PaintEventArgs e) { DerpedToolTipForm fffff = sender as DerpedToolTipForm; if (fffff != null) { fffff.ClientRectangle.Offset(1, 1); fffff.ClientRectangle.Inflate(-2, -2); var eargs = new DrawToolTipEventArgs(e.Graphics, fffff, (System.Windows.Forms.Control)fffff.Tag, fffff.ClientRectangle, fffff.ExTooltipText, this.BackColor, fffff.ForeColor, fffff.Font); if (this.Draw == null) { eargs.DrawBorder(); System.Windows.Forms.TextRenderer.DrawText(e.Graphics, fffff.ExTooltipText, fffff.Font, fffff.ClientRectangle.Location, this.ForeColor); } else { this.Draw.Invoke(sender, eargs); } } }
private void C_MouseEnter(object sender, EventArgs e) { System.Windows.Forms.Control c = sender as System.Windows.Forms.Control; if (c != null && c != this.currentControl) { this.CloseCurrentTip(); this.currentControl = c; this.currentTooltip = this.SetupAnotherTip(); var resultinfo = TextRendererWrapper.WrapString(this.innerToolTipText[c], this.PreferedSize.Width, this.Font, TextFormatFlags.Left); this.currentTooltip.ExTooltipText = resultinfo.Result; this.currentTooltip.Tag = c; Point awgkaugw = System.Windows.Forms.Cursor.Position; awgkaugw.Offset(3, 3); ExPopupEventArgs arrrrgggg = new ExPopupEventArgs(this.currentTooltip, c, false, new Size(resultinfo.Size.Width + 2, resultinfo.Size.Height + 2), awgkaugw); this.Popup?.Invoke(this.currentTooltip, arrrrgggg); this.currentTooltip.ClientSize = arrrrgggg.ToolTipSize; this.currentTooltip.DesktopLocation = arrrrgggg.Location; this.currentTooltip.Opacity = this.Opacity; this.ShowToolTip(this.currentTooltip); } }
private void ShowToolTip(DerpedToolTipForm _form) { _form.Show(); }
private void Result_FormClosed(object sender, FormClosedEventArgs e) { this.currentTooltip = null; this.currentControl = null; }