【发布时间】:2017-12-02 22:25:43
【问题描述】:
【问题讨论】:
-
我猜你已经看过这个链接了:c-sharpcorner.com/uploadfile/mahesh/…不确定它是否有助于“箭头形式”...
【问题讨论】:
注意:这个答案可能不是正确的方法,但它会起作用
使用Polygon 绘制ToolTip 的边框。如果您想要弯曲的边缘,请使用Path。这是一个代码示例。
<Button Content="?" ToolTipService.Placement="Bottom">
<ToolTipService.ToolTip>
<ToolTip Background="Transparent" BorderThickness="0">
<Grid>
<Polygon Fill="Gainsboro" Points="0,20,0,120,200,120,200,20,110,20,100,0,90,20" Stroke="Black" StrokeThickness="2" />
<StackPanel Margin="5,25,5,5">
<TextBlock Text="Information" FontSize="36" Foreground="Blue"/>
<TextBlock Text="This is a button" FontSize="18"/>
</StackPanel>
</Grid>
</ToolTip>
</ToolTipService.ToolTip>
</Button>
样本输出:
您可以使用自定义设计的Image 作为ToolTip 的边框。不要忘记设置HorizontalAlignment="Stretch" 和VerticalAlignment="Stretch"。这是一个代码示例。
<Button Content="?" ToolTipService.Placement="Bottom">
<ToolTipService.ToolTip>
<ToolTip Background="Transparent" BorderThickness="0">
<Grid>
<Image Source="Assets/ToolTipImage.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<StackPanel Margin="5,25,5,5">
<TextBlock Text="Information" FontSize="36" Foreground="Blue"/>
<TextBlock Text="This is a button" FontSize="18"/>
</StackPanel>
</Grid>
</ToolTip>
</ToolTipService.ToolTip>
</Button>
【讨论】: