2
我有一個對齊問題,我試圖從開始到結束定位標籤,但是它們從中間開始。有人可以闡明我需要做些什麼來改變它,並讓它與我想要的一致。在網格中對齊標籤WPF
<Grid Height="23.3" Margin="169,0,8,8.199" VerticalAlignment="Bottom" Width="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Rectangle Grid.ColumnSpan="6" Fill="#FFDDDDDD" Stroke="#FFD7D7D7" RadiusX="2" RadiusY="2"/>
<Label Grid.Column="1" Grid.Row="1" x:Name="lblAbout" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.about]}" HorizontalAlignment="Left" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height" MouseLeftButtonUp="lblAbout_MouseLeftButtonUp"/>
<Label Grid.Column="2" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.settings]}" HorizontalAlignment="Left" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height"/>
<Label Grid.Column="3" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.feedback]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" HorizontalAlignment="Left" Width="Auto" d:LayoutOverrides="Height"/>
<Label Grid.Column="4" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.help]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" HorizontalAlignment="Left" Width="Auto" d:LayoutOverrides="Height"/>
<Label Grid.Column="1" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.checkingUpdates]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height" Visibility="Collapsed"/>
</Grid>
那麼,你意識到你是從第1列開始的,而不是第0列,所以從一開始你就是一列?我不確定你希望他們如何對齊,也許你可以用photoshop的圖像來展示你想要的東西,你基本上只想讓它們從左到右串起來,而沒有很多空間(有點像菜單跳閘)? – CodingGorilla
感謝您的提示,我已經將我的代碼更改爲從col 0 –