0

谁能帮我解决我的问题?加载此视图时,扩展器确实会扩展,但在内容内部,网格不会左对齐。我已经尝试了我能想到的一切。任何帮助将不胜感激。

<Expander Background="White" FlowDirection="RightToLeft" Header="Test" BorderBrush="Black" BorderThickness="1" Margin="5">
        <Expander.Content>
            <Label Background="Orange" Margin="5" HorizontalContentAlignment="Left">
                    <Grid FlowDirection="LeftToRight" Width="816" HorizontalAlignment="Left">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="25"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <CheckBox Name="chkTest" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="15,0,0,0" Content="Test"/>
                        <TextBox Name="txtBlah" Grid.Row="0" Grid.Column="1" Text="Blah" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,0" />
                        <CheckBox Name="chkTest2" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="15,0,0,0" Content="Test2"/>
                        <TextBox Name="txtBlahBlah" Grid.Row="0" Grid.Column="3" Text="BlahBlah" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,0" />
                        <TextBlock Name="txtBlockTest3" Grid.Row="0" Grid.Column="4" Text="Test3" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="15,0,0,0"/>
                        <TextBox Name="txtTest4" Grid.Row="0" Grid.Column="5" Text="Test4" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5,0,0,0" />
                        <TextBlock Name="txtBlockTest5" Grid.Row="0" Grid.Column="6"  Text="Test5" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="15,0,0,0"/>
                        <ComboBox Name="cbTest6" Grid.Row="0" Grid.Column="7" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5,0,0,0"/>
                    </Grid>
            </Label>
        </Expander.Content>
    </Expander>
4

1 回答 1

1

从应该做FlowDirection="LeftToRight"的工作。GridLabel

<Label FlowDirection="LeftToRight" Background="Orange" Margin="5">
    <Grid Width="816" HorizontalAlignment="Left">
于 2012-05-01T14:51:30.063 回答