Click here to Skip to main content
15,913,027 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
After setting "OwnerDraw" property as "true" and later using Draw event handler we can draw custom shapes or strings but I wanted to know how can we set the rectangle or region of that tooltip so that the objects or shapes(like ellipse or pie or other shapes) get fit in it.

I tried like adding such code:


C#
private void toolTip1_Draw(object sender, DrawToolTipEventArgs e)
        {
            e.Graphics.FillPie(Brushes.Green, new Rectangle(0, 0, 30, 30), 0, 120);
        }


but this code works only if I add spaces or lines in the tooltip text so that to extend the region of tooltip. For the same I added :


C#
private void Form1_MouseHover(object sender, EventArgs e)
        {
            toolTip1.Show("                              \n\n\n", this);
        }



So I don't feel this as efficient solution to extend region. Is there any other way I could extend the rectangle or region of the tooltip? Moreover extending region this way won't help in having accurate spaces in various drawing performed on it.
Posted

1 solution

this link will help you

ToolTip With Image C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900