Textbox How to underline text? (MVVM) RRS feed

  • Question

  • Hello, I have a button and textbox. After button click I want text in textbox to will be underlined.

    How to do it? (I use mvvm)

    best regards

    Em Anton

    • Edited by Anton Em Friday, April 17, 2015 11:21 PM
    Friday, April 17, 2015 10:18 PM

All replies

  • Hi Anton Em, You can use BorderThickness property in border to achieve this.

    eg:- First set border brush visibility=collapse and when user click button then set Border Myunderline.visiblity=visiblity.visible;

     <Border BorderBrush="Red" BorderThickness="0,0,0,3" visiblity="collapse" X:Name="Myunderline">
                    <ColumnDefinition Width="Auto"/>
                <TextBlock Text="To:" Style="{StaticResource PhoneTextTitle2Style}" Margin="12,5" VerticalAlignment="Bottom"/>
    <Button Name="btnTextUnderline" fontsize="30" Click="btnTextUnderline_click">

    Don't forget to mark the right answer and vote up if helps you.

    Sunday, April 19, 2015 11:10 AM