Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show tooltip text by clicking a control [duplicate]

Tags:

c#

.net

winforms

Possible Duplicate:
Programatically show tooltip in winforms application

When set a TooltipText on a control, and the tooltip text will be shown when user move mouse on the control.

Now I have a picturebox on a windows form, what I want is to display the tooltip text by clicking the control instead of hover it.

How to do it?

Thanks.


1 Answers

This code will do the trick:

private void PictureBox1_Click(object sender, EventArgs e)
{
    int durationMilliseconds = 10000;
    ToolTip1.Show(ToolTip1.GetToolTip(PictureBox1), PictureBox1, durationMilliseconds);
}
like image 121
Steven Doggart Avatar answered Sep 19 '25 04:09

Steven Doggart