Tooltip background alternation

Total Post:108


 1451  View(s)
Rate this:

The single tooltip which shows different messages for different controls. Now the Problem is the background image is not fit/suitable to all messages. I supposed to call the draw event of the tooltip for custom size, Font etc.,

I able to successfully call the draw and Popup event of the tooltip for particular message but setting the generalized size for different messages(e.ToolTipText) is unknown to me.

public void tooltip_Popup(object sender, PopupEventArgs e)


    e.ToolTipSize = new Size(100, 100);


Kindly let me know anybody have any idea about it.

  1. Re: Tooltip background alternation

    Hi john,

    I found the answer for your Problem. The below code of POPUP event will change the tooltipsize according to the text size.

    public void toolTip_Popup(object sender, PopupEventArgs e) {
            using (Font f = new Font("Arial", 12f))
                e.ToolTipSize = TextRenderer.MeasureText(
                    toolTips.GetToolTip(e.AssociatedControl), f);

      Modified On Apr-03-2018 06:18:23 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.