devexpress LayoutControl控件里面的内边距的消除

原始效果图如下:

如何去掉红线部分的边距?

答:

padding margin 都不起作用

需要使用如下方式:

    <Window.Resources>
        <Style x:Key="CustomGroupBoxStyle" TargetType="{x:Type dxlc:GroupBox}">
            <Setter Property="Padding" Value="0"/>
        </Style>
    </Window.Resources>
<dxlc:LayoutControl Padding="0" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="1" Orientation="Vertical" HorizontalAlignment="Stretch"  x:Name="LayoutRoot">
            <dxlc:LayoutGroup VerticalAlignment="Stretch">
                <dxlc:LayoutGroup Header="目录" GroupBoxStyle="{StaticResource CustomGroupBoxStyle}"  View="GroupBox" Width="220" VerticalAlignment="Stretch" dxlc:LayoutControl.AllowHorizontalSizing="True">
                    <UserControls:UC_FileManageLeftTree />
                </dxlc:LayoutGroup>
                <dxlc:LayoutGroup Header="列表" View="GroupBox" VerticalAlignment="Stretch" dxlc:LayoutControl.AllowHorizontalSizing="True">
                    <dxlc:LayoutItem Label="姓名">
                    </dxlc:LayoutItem>
                </dxlc:LayoutGroup>
            </dxlc:LayoutGroup>
        </dxlc:LayoutControl>

注意上面红色标注部分

 

posted @ 2019-05-22 00:54  星星c#  阅读(566)  评论(1编辑  收藏  举报