简体   繁体   中英

WPF Change thickness left border textbox

I've to change the thickness of a textbox in WPF, but i don't know how to change only one border.

How can i do it?

thi is my code

<TextBox HorizontalAlignment="Left" Height="23" Margin="215,144,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>

To set for example the thickness of the left border only, you could write either this:

<TextBox BorderThickness="10,0,0,0" .../>

or this:

<TextBox ...>
    <TextBox.BorderThickness>
        <Thickness Left="10"/>
    </TextBox.BorderThickness>
</TextBox>
<TextBox HorizontalAlignment="Left" Height="23" BorderBrush="Red" Margin="215,144,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120" BorderThickness="5"/>

涂上边框笔刷,并将BorderThickness =“ 5,0,0,0”设置为所需的厚度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM