WPF登录窗体

WPF登录窗体

开发工具与关键技术:WPF
作者:zhh
撰写时间:2021.1.8
WPF的窗体初始样式在现在的审美是比较简陋的,所以大部分要自定义窗体。如图:
在这里插入图片描述
页面构成

<Grid  Background="#007DFA">
<Button VerticalAlignment="Top" HorizontalAlignment="Right" Width="40" Height="30" 
Template="{StaticResource ColseButtonTempate}"></Button>
<Rectangle Fill="#fcfcfb" Opacity="0.3" Width="350" Height="180" RadiusX="5" RadiusY="5" Stroke="Gray" VerticalAlignment="Top" Margin="-290,65,-290,0"/>
<TextBlock  Background="#eeeeee" Width="50" Height="30" VerticalAlignment="Top" Margin="-490,95,-290,0" Text="帐号" TextAlignment="Center" Padding="8"/>
<!--MaxLength属性:输入值的最大长度,不包含硬编码中Text的字符长度-->
<!--TextWrapping:如果设置成wrap ,就表示当文本长度超过容器长度时可以自动换行。
默认为no wrap,即当文本长度超过容器长度时,文本超出部分被遮挡。-->
<!--AcceptsReturn:允许回车换行操作-->
<TextBox Background="White" Width="200" Height="30" AcceptsReturn="True" MaxLength="20" TextWrapping="NoWrap" FontSize="16" Margin="50,-60,0,0" Padding="4"/>
            <TextBlock  Background="#eeeeee" Width="50" Height="30" VerticalAlignment="Top" Margin="-490,135,-290,0" Text="密码" TextAlignment="Center" Padding="8"/>
            <PasswordBox Background="White" Width="200" Height="30" FontSize="16" Margin="50,20,0,0" MaxLength="20" Padding="4"></PasswordBox>
            <!--Content:作用与TextBox的Text属性一样,但其数据类型为object,即可放任何对象,但只能存放一个对象-->
<Button Name="btn_Login" Style="{StaticResource NewButton}" Content="登录" Height="35" Width="70" FontSize="19" Cursor="Hand" Background="#DDD" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="130,180,0,0" FontFamily="Vivaldi"> </Button>
<!--Cursor:当光标进入控件范围时使用的鼠标指针-->
 <Button Style="{StaticResource NewButton}" Height="35" Width="70" FontSize="15" Foreground="White" Background="#BBB" Content="退出"  HorizontalAlignment="Left"  VerticalAlignment="Top"  Margin="280,180,-290,0"  Cursor="Hand" FontFamily="Vivaldi"/>
</Grid>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值