Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi every body
i search the web for TextBox with rounded corners and find a xaml code like below:

C#
 <Style TargetType="{x:Type TextBox}">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate >
                        <Border removed="{TemplateBinding Background}" x:Name="Bd" 
BorderThickness="2" CornerRadius="5" BorderBrush="#FFF9EAB6">
                           

 <ScrollViewer x:Name="PART_ContentHost" />


                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#FFC7B0B0"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#FFC7B0B0"/>
                                <Setter Property="Foreground" Value="Black"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="False">
                                <Setter Property="Foreground" Value="#FFC7B0B0"/>
                            </Trigger>
                            <Trigger Property="Width" Value="Auto">
                                <Setter Property="MinWidth" Value="120"/>
                            </Trigger>
                            <Trigger Property="Height" Value="Auto">
                                <Setter Property="MinHeight" Value="27"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>

                </Setter.Value>
            </Setter>
        </Style>



i want to find out what is
C#
<ScrollViewer x:Name="PART_ContentHost" />

in detail and why not properly work my template if delete this line from it,
please tell me completely in detail.
thanks alot.
Posted
Comments
Sergey Alexandrovich Kryukov 8-May-12 23:20pm    
Not quite clear, except one obvious thing: ScrollViewer has nothing to do with rounded corners of a border.
--SA

 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900