控件未显示在组框下

时间:2014-12-01 13:12:59

标签: wpf xaml

我的xaml文件中有一个groupbox,其中包含Label,Image,DataGrid和两列,一个文本框和一个进度条。但是当我编译我的表单并运行它时,不会显示此组框的控件。但是,显示其他组框的控件。

这是我在xaml中的组框:

<GroupBox HorizontalAlignment="Left" Height="400" Margin="25,150,0,0" VerticalAlignment="Top" Width="411" BorderBrush="#FF0788F3" Style="{DynamicResource GroupBoxStyle1}" Grid.RowSpan="2">
            <StackPanel Margin="-4,1,-5,-7" RenderTransformOrigin="0.5,0.5">
                <Label Content="Text" x:Name="label4" Margin="6,40,242,0" VerticalAlignment="Top" FontFamily="Ebrima" FontSize="16" Padding="5" Background="#FF3053B0" FontWeight="Bold"/>
                <Image x:Name="Image" HorizontalAlignment="Left" VerticalAlignment="Top" Width="62" Height="42" Margin="185,-30,0,0" />
                <DataGrid x:Name="InstallableGrid" Margin="10,15,0,0" HeadersVisibility="Column" VerticalAlignment="Top" FontSize="14" Height="138" Background="#FFF5F3C7" RowBackground="#FF37AEC9" AlternatingRowBackground="LightBlue" CanUserAddRows="False"  KeyboardNavigation.TabNavigation="None" AutoGenerateColumns="True" IsReadOnly="True" VirtualizingPanel.VirtualizationMode="Standard" HorizontalGridLinesBrush="Black" HorizontalAlignment="Left" Width="333" SelectionChanged="InstallableGrid_SelectionChanged">
                    <DataGrid.Columns>
                        <DataGridCheckBoxColumn Header="Select" ElementStyle="{StaticResource CheckBoxStyleInverted}"   />
                    </DataGrid.Columns>
                </DataGrid>
                <TextBox x:Name="PBarTimer" Background="#FFF5F3C7" Foreground="Red" HorizontalAlignment="Left" Height="20" Margin="10,45,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="55" FontSize="14" Padding="1,-1,1,1" RenderTransformOrigin="-0.249,0.84"/>
                <ProgressBar x:Name="PBar" Background="#FFF5F3C7" HorizontalAlignment="Left" Height="20" Margin="75,-20,0,0" VerticalAlignment="Top" Width="268" IsIndeterminate="True" RenderTransformOrigin="0.596,0.765"/>

            </StackPanel>
        </GroupBox>
PS:我是wpf的一个完全初学者,我基本上是一个Linux人,所以我在这里犯的问题可能非常愚蠢,我确实尝试谷歌搜索这个问题,但找不到任何帮助。

0 个答案:

没有答案