Articles in this section

How to display the scrollbar even after clicking the reset button in a WinForms Chart?

In WinForms Chart control, to display scrollbar even if Reset button in scrollbar is clicked, the scrollbar visibility should be set to true by using Chart Control's ZoomButtonClicked event.

this.chartControl1 = new ChartControl();
. . .

// Enable axis zooming and set initial zoom so scrollbars appear
this.chartControl1.EnableXZooming = true;
this.chartControl1.ZoomFactorX = 0.5;

// Invoke the ZoomButtonClicked event
this.chartControl1.GetHScrollBar(this.chartControl1.PrimaryXAxis).ZoomButtonClicked += Form1_ZoomButtonClicked;

// Force the scrollbar to remain visible after Reset is clicked (X axis)
void Form1_ZoomButtonClicked(object sender, Syncfusion.Windows.Forms.Chart.Scrolling.ChartScrollBarZoomButtonClickedEventArgs args)
{
    chartControl1.GetHScrollBar(chartControl1.PrimaryXAxis).Visible = true;
}
Me.ChartControl1 = New ChartControl()
. . .

' Enable axis zooming and set initial zoom so the scrollbar appears
ChartControl1.EnableXZooming = True
ChartControl1.ZoomFactorX = 0.5R

' Subscribe to the ZoomButtonClicked event on the horizontal scrollbar
Dim hScroll = ChartControl1.GetHScrollBar(ChartControl1.PrimaryXAxis)
If hScroll IsNot Nothing Then
    AddHandler hScroll.ZoomButtonClicked, AddressOf Form1_ZoomButtonClicked
End If

 ' Force the scrollbar to remain visible after Reset is clicked (X axis)
 Private Sub Form1_ZoomButtonClicked(sender As Object, e As Syncfusion.Windows.Forms.Chart.Scrolling.ChartScrollBarZoomButtonClickedEventArgs)
     Dim hScroll = ChartControl1.GetHScrollBar(ChartControl1.PrimaryXAxis)
     If hScroll IsNot Nothing Then
         hScroll.Visible = True
     End If
 End Sub

Output

ScrollBarVisibility

Conclusion

I hope you enjoyed learning about how to display scrollbar even if after clicking the reset button.

You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our 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 other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied