Refresh the panels of a SplitContainer as the splitter moves

Viewed 8172

I have a SplitContainer with two panels. When I drag the splitter to resize the two panels, I see a grayish bar as I'm dragging. The panels don't actually get redrawn until I release the mouse button. How can I make the panels refresh as I drag the splitter?

Fwiw, this is achieved in Delphi by setting the "ResizeStyle" of the Splitter control to "rsUpdate".

I have tried putting the following code inside the SplitterMoving event with no visible changes.

private void splitCont_SplitterMoving(object sender, SplitterCancelEventArgs e)
{
    splitCont.Invalidate();
    //also tried this:
    //splitCont.Refresh();
}
1 Answers
Related