views:

162

answers:

2

Is it possible to increase the distance from a grid splitter from which the user can grab it?

My splitter is only 1px in width. I would like to be able to grab the splitter from a greater distance.

As it is now i must point the mouse on the exact 1px line to grab it.

And the splitter must still be 1px in width

+1  A: 

Just set the width property on the gridsplitter:

<GridSplitter Width="4">
17 of 26
Forgot to mention that in the question; the splitter must be 1px.I have updated my question to clarify.
Erik
I think this is the only way.
Benny Jobigan
+2  A: 

You can change the actual size of the GridSplitter while keeping it looking like it's smaller. This will give you a 7 pixel width area to grab it while showing at 1 pixel:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition Width="1"/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <GridSplitter Grid.Column="1" Margin="-3,0" BorderThickness="3,0" BorderBrush="Transparent"
                  HorizontalAlignment="Stretch" />
</Grid>

The example is using the method of giving the splitter its own column but the same principle applies if it's Left or Right aligned in a shared column.

John Bowen
This is correct, but i had to change the ZIndex of the gridsplitter, because it right hand side got hidden by a DockPanel.
Erik