8.24 Adding Tooltips to Controls

 <  Day Day Up  >  

You want to create tooltips and assign them to individual controls on your Windows Form.


To display a tooltip for a control, use the ToolTip control by dragging it from the form designer toolbox. Although the ToolTip control is a visual control during runtime, it appears in the form designer control tray at the bottom of the designer window. The ToolTip control has properties that allow you to specify how long the delay is in milliseconds for the tooltip to display, how long the tooltip appears, and the text for the tooltip. Once you create a ToolTip control in the form designer, each control on a form adds a ToolTip property in its corresponding property list displayed in the property browser. Associate a tooltip with a control by accessing the ToolTip drop-down list for each individual control. Also note that you can use the same ToolTip for multiple controls.


Sometimes a control containing a text label and associated image just isn't enough information for a user. Rather than force a user to launch your help system and spend precious moments searching for a help topic, you can use tooltips to give them that extra bit of information they're looking for.

The ToolTip control remains invisible to the user until a certain event occurs. This event is generally a mouse hover action in which the mouse cursor remains motionless over a control for a short period of time. Once that time period elapses, a small text message appears, giving additional information about the control the mouse is hovering over. By default, most Windows Forms do not implement their own tooltip behavior. Rather, they rely on the ToolTip class to do it for them. Once you add a ToolTip control to a Windows Form, you can associate it with each control that uses the tooltip using the ToolTip property, which is available within the control's properties in the property browser. Without a defined ToolTip control in the form, these properties are hidden within the property browser.

 <  Day Day Up  >  

Microsoft Visual C# .Net 2003
Microsoft Visual C *. NET 2003 development skills Daquan
ISBN: 7508427505
EAN: 2147483647
Year: 2003
Pages: 440

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net