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>

你可能感兴趣的:(password)