登陆界面上的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>