How to improve scrolling speed in WinForms ScrollersFrame?
Improve the scrolling performance
When large number of WinForms ScrollerFrame controls are added to the Gradient Panel whose size is smaller than the added controls, and when you scroll for the invisible controls, then time delay may occur to paint the newly visible controls. This can be resolved by overriding the function OnScroll of the UserControl.
The following code example demonstrates the same.
C#
//Overriding OnScroll method of the UserControl protected override void OnScroll(ScrollEventArgs se) { if (se.ScrollOrientation == ScrollOrientation.VerticalScroll) { this.VerticalScroll.Value = se.NewValue; } else if (se.ScrollOrientation == ScrollOrientation.HorizontalScroll) { this.HorizontalScroll.Value = se.NewValue; } this.Invalidate(); base.OnScroll(se); }
VB
'Overriding OnScroll method of the UserControl Protected Overrides Sub OnScroll(ByVal se As ScrollEventArgs) If se.ScrollOrientation = ScrollOrientation.VerticalScroll Then Me.VerticalScroll.Value = se.NewValue ElseIf se.ScrollOrientation = ScrollOrientation.HorizontalScroll Then Me.HorizontalScroll.Value = se.NewValue End If Me.Invalidate() MyBase.OnScroll(se) End Sub
Samples:
C#: http://www.syncfusion.com/downloads/support/directtrac/135929/ScrollersFrame_OnScroll-555157854.zip
VB: http://www.syncfusion.com/downloads/support/directtrac/135701/ScrollersFrame_OnScroll_VB90170541.zip
Conclusion
I hope you enjoyed learning about how to improve scrolling speed in WinForms ScrollersFrame.
You can refer to our WinForms ScrollerFrame’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms ScrollerFrame documentation to understand how to present and manipulate data.
For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms ScrollerFrame and other WinForms components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!