-3

This is my question as a beginner programmer. I have a C# form application. I want to show a message while mouse cursor is waiting on a label, a textbox or a button. How can I do that?

Thanks in advance

Teknikaali
  • 135
  • 2
  • 11
S. Abbak
  • 15
  • 2
  • 1
    Use MouseHover event – kgzdev Feb 01 '17 at 11:42
  • have a look at the Mouse events of the controls – Wheels73 Feb 01 '17 at 11:42
  • 3
    @M.kazemAkhgary " its good question" - actually not so much. It doesn't show much effort and an answer that would completely explain how to do it would be rather long. (Did not DV myself) S.Abbak: There is a little manual on writing Questions on SO: [ask]. – Fildor Feb 01 '17 at 11:46
  • 1
    What have you tried so far? The functionality you're looking for is called "ToolTip", you can use that keyword to find more on the subject. Possible duplicate of http://stackoverflow.com/questions/168550/display-a-tooltip-over-a-button-using-windows-forms – Teknikaali Feb 01 '17 at 11:48

1 Answers1

2

You can either use mouse events or register a ToolTip for the object like this:

 ToolTip toolTip1 = new ToolTip();

 // Set up the delays for the ToolTip.
 toolTip1.AutoPopDelay = 5000;
 toolTip1.InitialDelay = 1000;
 toolTip1.ReshowDelay = 500;

 // Set up the ToolTip text for the Button.
 toolTip1.SetToolTip(this.button1, "Hey it works!");
Fildor
  • 14,510
  • 4
  • 35
  • 67
Nico
  • 1,727
  • 1
  • 24
  • 42