代码改变世界

为Silverlight 控件添加工具提示

2011-05-13 07:53  火-麒-麟  阅读(170)  评论(0编辑  收藏  举报

<Button Width="60" Height="20" Content="My Button">
<ToolTipService.ToolTip>
<ToolTip Content="This is tool tip for Button"></ToolTip>
</ToolTipService.ToolTip>
</Button>

 

<TextBox Width="60" Height="20" Text="My Text">
<ToolTipService.ToolTip>
<Image Source="http://www.abc.com/images/abc.jpg" >
</Image>
</ToolTipService.ToolTip>
</TextBox>

 

ToolTipService.SetToolTip(MyButton, "This is new tooltip");