GridSplitter resize next

折月煮酒 提交于 2019-12-02 07:32:31

I made it work by changing ColumnDefinition Width

<Grid>
    <Grid Background="Gray" HorizontalAlignment="Left">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="1" Width="10" ResizeBehavior="PreviousAndNext" />
    </Grid>
    <Grid Background="Gray" HorizontalAlignment="Right">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="100" />
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="1" Width="10" ResizeBehavior="PreviousAndNext" />
    </Grid>
</Grid>

and another variant I like more:

<Grid>
    <Grid Background="Gray">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="100" />
        </Grid.ColumnDefinitions>

        <GridSplitter Grid.Column="1" Width="10" ResizeBehavior="PreviousAndNext" />

        <Border Grid.Column="2" Background="Gold"/>

        <GridSplitter Grid.Column="3" Width="10" ResizeBehavior="PreviousAndNext" />
    </Grid>
</Grid>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!