首页 > 代码库 > 实战基础技能(07)--------WPF的登录界面的排版
实战基础技能(07)--------WPF的登录界面的排版
一:截图
二:XAML代码
<Window x:Class="wpf练习.登录窗体" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="登录窗体" Height="200" Width="300"> <Grid> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <TextBlock Text="用户名:" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> <TextBox Name="txtName" Text="红马車" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Row="0" Grid.Column="0" Margin="10" Grid.ColumnSpan="2" Width="175" HorizontalAlignment="Right"></TextBox> <TextBlock Text="密码:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" ></TextBlock> <PasswordBox Name="pwdInfo" Grid.Row="1" Grid.Column="0" Margin="10" Grid.ColumnSpan="2" Width="175" HorizontalAlignment="Right"></PasswordBox> <Button Name="btnLogin" Content="登录" Grid.Column="0" Grid.Row="2" Margin="10" Width="75"></Button> <Button Name="btnCancel" Content="取消" Grid.Column="2" Grid.Row="2" Margin="10" Width="75"></Button> </Grid> </Grid></Window>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。