我在网格中放置组件时遇到问题。
atm 的输出是这样的:
我想要做的只是让组件像这样并排放置:
这是我当前的代码:
<Grid x:Name="Components" Margin="8,8,0,8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="1" Grid.Column="0" Content="{Binding .[Language.timeOptions1], Mode=OneWay, Source={StaticResource localisation}}" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="11" Foreground="#FF585858" FontFamily="Myriad Pro" Height="23.2"/>
<TextBox Grid.Row="1" Grid.Column="1" MaxLength="2" x:Name="textTimeHour" TextWrapping="NoWrap" VerticalAlignment="Top" HorizontalAlignment="Left" FontFamily="Myriad Pro" Style="{DynamicResource style1Text}" Height="25.2"/>
<Label Grid.Row="1" Grid.Column="1" Content=":" HorizontalAlignment="Left" FontSize="11" Foreground="#FF585858" FontFamily="Myriad Pro" VerticalAlignment="Top"/>
<TextBox Grid.Row="1" Grid.Column="2" MaxLength="1" x:Name="textTimeMin" TextWrapping="NoWrap" VerticalAlignment="Top" FontFamily="Myriad Pro" Style="{DynamicResource style1Text}" Height="25.2" HorizontalAlignment="Left" Width="Auto"/>
<Button Width="80" Grid.Row="1" Grid.Column="2" x:Name="btnNow" Content="{Binding .[Language.now], Mode=OneWay, Source={StaticResource localisation}}" VerticalAlignment="Top" Style="{DynamicResource style1Btn}" Height="25.2" FontSize="9.333" Click="btnNow_Click"/>
<TextBlock Grid.Row="2" Grid.Column="0" x:Name="blockIgnoreDate" Text="{Binding .[Language.timeOptions2], Mode=OneWay, Source={StaticResource localisation}}" HorizontalAlignment="Left" FontSize="11" Foreground="#FF585858" FontFamily="Myriad Pro" Height="23.202"/>
<Custom:DatePicker Grid.Row="2" Grid.Column="1" x:Name="pickerDate" d:LayoutOverrides="Width" FontFamily="Myriad Pro" IsTodayHighlighted="False" Foreground="#FF585858" Height="24" />
<CheckBox Grid.Row="2" Grid.Column="2" x:Name="checkIgnoreDate" Content="{Binding .[Language.ignoreDate], Mode=OneWay, Source={StaticResource localisation}}" Foreground="#FF585858" Background="{x:Null}" Checked="checkIgnoreDate_Checked" Unchecked="checkIgnoreDate_Unchecked" Height="15.96"/>
<Button Grid.Row="3" Grid.Column="0" x:Name="btnAddTask" Content="{Binding .[Language.addTask], Mode=OneWay, Source={StaticResource localisation}}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Style="{DynamicResource style1Btn}" Click="btnAddTask_Click" Height="24.65"/>
</Grid>
有人可以指出我正确的方向吗?