WPF passwordbox 圆角制作

将以下节点复制到app.xaml的<Application.Resources>节点下

<Style TargetType="PasswordBox">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="PasswordBox">
                        <Grid>
                            <Rectangle RadiusX="3" RadiusY="3" Fill="{TemplateBinding Background}" Stroke="#7e94a9"/>
                            <ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost" Template="{DynamicResource ScrollViewerControlTemplate1}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

posted on 2013-06-28 10:49  认真的我  阅读(1642)  评论(0编辑  收藏  举报