2012-07-12 87 views
0

如何更改工具提示的顏色在我的代碼如何更改工具提示的顏色

<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> 

回答

2

創建自己的工具提示風格See Here

注意,樣式應該必須defult <Style TargetType="ToolTip"> ... </Style>

讓它應用「textBoxInError」樣式。