开发者

How can I override BorderBrush?

I have a st开发者_JS百科yle to a textbox, and I want in the application layer override de BorderBrush of this style.

I tried: d:LayoutOverrides="BorderBrush". But this doesn't work.

I want the same style, but with a red BorderBrush.

How can I do this please?

Thank you.


as you mentioned Blend in your tags: you can right-click a textbox search templates and create new ones from the existing (Edit a Copy). This will extract the complete definition of the textbox and you can change everything you want there.

Here is everything explained step-by-step: Create or edit a control template


Base your style on your old one and change the Border brush

<Style TargetType="TextBox" BasedOn="{StaticResource oldBrushKey}">
    <Setter Property="BorderBrush" Value="Red" />
</Style>

or if it's the default style you want to override use

BasedOn="{StaticResource {x:Type TextBox}}"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜