Add a tooltip for the Silverlight Control

Source: Internet
Author: User

Silverlight provides a control named "tooltipservice" for the Silverlight Control
A tooltip is displayed. This class can be attached to most UI elements in Silverlight for displaying tooltip.

Simple text prompt
The following exampleCodeDisplay how to add a tooltip for a button control:

 <  Button  Width  = "60"  Height  = "20"  Content  = "My button"  >  
< Tooltipservice. tooltip >
< Tooltip Content = "This is tool tip for button" > </ Tooltip >
</ Tooltipservice. tooltip >
</ Button >

Show rich UI element prompt
Silverlight supports UI elements when prompted to provide a better user experience. You can enable
Use more UI elements. See the example shown below
Display images in the prompt Tool
The sample code shows how to display the image tooltip in Silverlight:

 <  Textbox  Width  = "60"  Height  = "20"  Text  = "My text"  >  
< Tooltipservice. tooltip >
< Image Source = "Http://www.abc.com/images/abc.jpg" >
</ Image >
</ Tooltipservice. tooltip >
</ Textbox >

Set tooltip in programming mode
You can set or change the tooltip from the background code file. The following example shows how to set the background code file as a button control.
Text tip:

 
Tooltipservice. settooltip (mybutton,"This is new tooltip");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.