You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.9 KiB

<Window x:Class="LabelTextBlockTextBoxSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:LabelTextBlockTextBoxSample"
mc:Ignorable="d"
Title="Customer Registration" Height="450" Width="400"
FocusManager.FocusedElement="{Binding ElementName=txtName}">
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="1" Background="LightGray">
<Label Content="Name(_N):" Target="{Binding ElementName=txtName}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<TextBox Grid.Column="1" Grid.Row="0" x:Name="txtName"/>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="DarkGray" BorderThickness="1" Background="LightGray">
<StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Center">
<Image Source="\Resources\telephone.png" Height="20" HorizontalAlignment="Center"/>
<Label Content="Telephone(_T):" VerticalAlignment="Center" Target="{Binding ElementName=txtTel}"/>
</StackPanel>
</Border>
<TextBox Grid.Column="1" Grid.Row="1" x:Name="txtTel"/>
<Border Grid.Column="0" Grid.Row="2" BorderBrush="DarkGray" BorderThickness="1" Background="LightGray">
<Label Content="Sex(_S):" HorizontalAlignment="Center" VerticalAlignment="Center" Target="{Binding ElementName=cboSex}"/>
</Border>
<ComboBox Grid.Column="1" Grid.Row="2" x:Name="cboSex" Width="150" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" SelectedIndex="0">
<ComboBoxItem Content="Male"/>
<ComboBoxItem Content="Female"/>
</ComboBox>
<Border Grid.Column="0" Grid.Row="3" BorderBrush="DarkGray" BorderThickness="1" Background="LightGray">
<Label Content="Note(_N):" HorizontalAlignment="Center" VerticalAlignment="Center" Target="{Binding ElementName=txtNote}"/>
</Border>
<TextBox Grid.Column="1" Grid.Row="3" x:Name="txtNote" Height="100"
AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap"/>
</Grid>
</Window>