One way to do it is to have a class variable to independantly hold the current position of the splitter and a flag to indicate if the mouse button is down:
int split_distance = 150;
bool mouse_down = false;
Then add the following event handlers to the split container:
private void splitContainer1_Layout ( object sender, LayoutEventArgs e )
{
this.splitContainer1.SplitterDistance = this.split_distance;
}
private void splitContainer1_MouseDown ( object sender, MouseEventArgs e )
{
this.mouse_down = true;
}
private void splitContainer1_MouseUp ( object sender, MouseEventArgs e )
{
this.mouse_down = false;
}
private void splitContainer1_SplitterMoving ( object sender, SplitterCancelEventArgs e )
{
if ( this.mouse_down )
{
this.split_distance = e.SplitX;
}
}