开发者

xaml how to create a trigger for textbox? active when typing

I have a textbox, i want add a trigger, when i click that textbox, the textbox wi开发者_高级运维ll change border color, untill typing is finish please help me useing xaml


Try this

    <Style TargetType="{x:Type TextBox}">
        <Style.Triggers>
            <Trigger Property="IsFocused"  Value="True">
                <Setter Property="BorderBrush" Value="Red"/>
                <Setter Property="BorderThickness" Value="2"/>
            </Trigger>
        </Style.Triggers>
    </Style>


You are asking for a Trigger but a different styling for the Focused state would be my preferred way of doing this

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜