S
S
Slavka2016-12-03 00:59:01
WPF
Slavka, 2016-12-03 00:59:01

Using templates in WPF?

<Style TargetType="TextBox">
        <Setter Property="Margin" Value="5" />
        <Setter Property="Background" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Border CornerRadius="10" Padding="2">

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

I wanted to round the edges of the textbox, but instead the element was no longer displayed on the form, I can’t understand where I’m making a mistake

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanostee, 2016-12-03
@andrewpianykh

Add a Border inside
<ScrollViewer x:Name="PART_ContentHost" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question