2

How do i get this? Which control shows some text when i keep the mouse cursor there for a while?

enter image description here

Edit: I have a timeline in my program. I want the tooltip to show the time value in milliseconds at the point where the mouse cursor is... Is it possible to have a flexible tooltip over a control?

techmanc
  • 293
  • 1
  • 7
  • 19

4 Answers4

3

You are asking for the ToolTip control.


Refer to the following:

Tooltip in C#

Normal Tooltip

Balloon Tooltip

Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
2

ToolTip is the magic word. Have a look at the docs.

DanielB
  • 19,910
  • 2
  • 44
  • 50
2

I think this is what you're looking for

How To Add ToolTips To Controls On A Windows Form

Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
Jordan Foreman
  • 3,848
  • 7
  • 40
  • 65
0

if you want to display some text over the print button named "printBtn", Then add the event mouse hover as below

printBtn.MouseHover += new EventHandler(printBtn_MouseHover);

Then, use the following code to display the text when the mouse is over the print button

void printBtn_MouseHover(object sender, EventArgs e)
{
   ToolTip tip = new ToolTip();
   tip.SetToolTip(printBtn, "Click to print");
}
Uthistran Selvaraj
  • 1,371
  • 1
  • 12
  • 31