Model.SplitterMoving Property
WinForms: When the viewport control is hosted inside a SplitContainer control an annoying repaint issue is present during SplitContainer splitter moving.
WPF: When the viewport control is hosted inside a Grid control with GridSplitter an annoying repaint issue is present during GridSplitter moving.
Setting properly this flag it can be avoided.
The following code fragment demonstrates the usage of the SplitterMoving flag to
avoid the SplitControl repaint issue during GridSplitter moving.
// WinForms bool first = true; private void splitContainer1_SplitterMoving(object sender, SplitterCancelEventArgs e) { if (first == true) { MainViewport.SplitterMoving = true; first = false; } } private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e) { first = true; MainViewport.SplitterMoving = false; } // WPF private void GridSplitter1_PreviewMouseDown(object sender, MouseButtonEventArgs e) { MainViewport.SplitterMoving = true; } private void GridSplitter1_PreviewMouseUp(object sender, MouseButtonEventArgs e) { MainViewport.SplitterMoving = false; }
This language is not supported or no code example is available.
// WinForms Dim first As Boolean = True Private Sub SplitContainer1_SplitterMoving(ByVal sender As System.Object, ByVal e As System.Windows.Forms.SplitterCancelEventArgs) Handles SplitContainer1.SplitterMoving If first = True Then MainViewport.SplitterMoving = True first = False End If End Sub Private Sub SplitContainer1_SplitterMoved(ByVal sender As System.Object, ByVal e As System.Windows.Forms.SplitterEventArgs) Handles SplitContainer1.SplitterMoved first = True MainViewport.SplitterMoving = False End Sub // WPF Private Sub GridSplitter1_PreviewMouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles GridSplitter1.PreviewMouseDown MainViewport.SplitterMoving = True End Sub Private Sub GridSplitter1__PreviewMouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles GridSplitter1.PreviewMouseUp MainViewport.SplitterMoving = False End Sub
This language is not supported or no code example is available.