[WPF] WPF做的漂亮的登陆界面[附源码]

44ca6467a799a41ee5813b0f8cc5f799.png

登陆界面上的logo都是从网上找的,请大家替换成自己公司的logo即可。。。。。

WPF界面库,非常漂亮的WPF界面【附源码】

https://www.itsvse.com/thread-4941-1-1.html


WPF登陆界面美化:

1:账号和密码框都做了美化,

2:关闭按钮和登陆按钮都做了美化,当鼠标移动上去,都做了处理,

3:总体界面四个边角是圆弧形,挺好看的。。。。

代码如下,源码会在帖子下方:

<Window x:Class="WpfFrist.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         WindowStyle="None" AllowsTransparency="True" Background="{x:Null}"
        Title="MainWindow" Height="300" Width="300" WindowStartuplocatio{过滤}n="CenterScreen">
    <Grid  Width="{Binding Width, ElementName=w}" Height="{Binding Height, ElementName=w}">
        <Grid.RowDefinitions>
            <RowDefinition Height="150" />
            <RowDefinition Height="50" />
            <RowDefinition Height="50" />
            <RowDefinition  />
        </Grid.RowDefinitions>
        <Border Grid.RowSpan="4" BorderBrush="Gray" BorderThickness="3" CornerRadius="20" Margin="10"  Opacity="1"  Background="White"></Border>
        <Button Style="{StaticResource BtnCloseStyle}" Name="btnClose"  Grid.Row="0"  Click="Button_Click" ></Button>
        <Image Grid.Row="0"  VerticalAlignment="Center" Width="120"  Height="120" Source="/Resources/QQ截图20161123091013.png" />
        <TextBox x:Name="UserTextBox"  Grid.Row="1"  Width="200" VerticalAlignment="Center" BorderThickness="0,0,0,1" Height="23"></TextBox>
        <TextBlock Foreground="DarkGray"  Grid.Row="1"  IsHitTestVisible="False" HorizontalAlignment="Center" Height="23" Text="请输入用户名" VerticalAlignment="Center" Width="90" FontFamily="Microsoft YaHei">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="Visibility" Value="Collapsed"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Text, ElementName=UserTextBox}" Value="">
                            <Setter Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                    </Style.Triggers>
</Style>
            </TextBlock.Style>
        </TextBlock>
        <TextBox  x:Name="PwdTextBox"   Grid.Row="2"  Width="200" VerticalAlignment="Center" BorderThickness="0,0,0,1" Height="23"></TextBox>
        <TextBlock Foreground="DarkGray" Grid.Row="2"  IsHitTestVisible="False" HorizontalAlignment="Center" Height="23" Text="请输入密码" VerticalAlignment="Center" Width="90" FontFamily="Microsoft YaHei">
            <TextBlock.Style>
                <Style TargetType="{x:Type TextBlock}">
                    <Setter Property="Visibility" Value="Collapsed"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Text, ElementName=PwdTextBox}" Value="">
                            <Setter Property="Visibility" Value="Visible"/>
                        </DataTrigger>
                    </Style.Triggers>
</Style>
            </TextBlock.Style>
        </TextBlock>
        <Button Name="btnlogin" Click="btnlogin_Click" Grid.Row="2" Style="{StaticResource BtnLoginStyle}"  >
            <!--<Button.Background>
                <ImageBrush ImageSource="/Resources/LoginBtn.jpg" Stretch="Fill"/>
            </Button.Background>-->
        </Button>
    </Grid>
</Window>

-----------------------------------

需要进技术群交流的,请添加小编mm1552923

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值