如何在代码中更改ToolTip颜色
<Style x:Key="textBoxInError" TargetType="TextBox">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
</Trigger>
</Style.Triggers>
</Style>发布于 2012-07-12 17:04:01
创建您自己的工具提示样式See Here
请注意,样式必须是默认的<Style TargetType="ToolTip"> ... </Style>
让它应用"textBoxInError“样式。
https://stackoverflow.com/questions/11448323
复制相似问题