dispose tooltips after usage

extase

New member
Joined
Jan 2, 2007
Messages
3
Programming Experience
Beginner
Hi!!


I have a textbox.mouserhover event, which creates a tooltip with the content of the textbox. Because of the fact, that it keeps creating tooltips when the mouse stays above the textbox, i want to dispose the tooltip after it disapeared/hides or when the muserhoversubroutine ends.

The problem is, that i can't dispose it at the end of the subroutine, because I create it there. Maybe there is an option to wait for about ten seconds(keep the programm in idle mode) and then dispose it . Furthermore I don't have a clue how to address a tooltip after i leave a sub, so i could dispose it later or in an other event.
 
Why do you have to create a new Tooltip on mouse hover? Normal use is add one Tooltip control to form in design mode and just use its .SetToolTip method to display text for different other control when needed. Actually you don't even have to write the code, when the example Tooltip1 is added to form you can select the different other controls and they will have a new designer property "Tooltip on Tooltip1" where you can just write in the text to display on hover.
 
It is much simpler in Design mode :). I have completly forgotten that, because i prefer to create everything in the code :).

...when the example Tooltip1 is added to form you can select the different other controls and they will have a new designer property "Tooltip on Tooltip1" where you can just write in the text to display on hover.

To be honest i didn't get that. Can you explain what you mean by that?? (Maybe with codeexample)
 
Add a Tooltip control to form in designer view from Toolbox. Select any other control on form and review its properties, they will now all have the new "Tooltip on Tooltip1" property as you can see in attached screenshot. In this property you can just write the text to display on mouse hover. The Tooptip itself may also be configured by selecting it in designer view at setting its properties there.
 

Attachments

  • tooltip property.jpg
    tooltip property.jpg
    18.4 KB · Views: 46
Back
Top