Display and Hide Scroll Bars
Scroll bars are useful for navigating the contents of spreadsheets that are wide and deep, that is, that have many rows and columns. Most applications support two types of scroll bar:
- Vertical scroll bar
- Horizontal scroll bar
Both of these are found in Microsoft Excel.
Aspose.Cell’s GridDesktop API provides horizontal and vertical scroll bars for scrolling through the contents of a worksheet. With the Aspose.Cells.GridDesktop APIs, developers can control the visibility of both of these scroll bars.
Controlling Scroll Bar Visibility
To control scroll bar’s visibility in the GridDesktop, use the IsVerticalScrollBarVisible and IsHorizontalScrollBarVisible properties. The examples below show how to hide and show scroll bars.
Programming Samples: Hiding Scroll Bars
To hide scrollbars, set the properties that control visibility to false.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Hiding the vertical scroll bar | |
gridDesktop1.IsVerticalScrollBarVisible = false; | |
// Hiding the horizontal scroll bar | |
gridDesktop1.IsHorizontalScrollBarVisible = false; |
Programming Samples: Making Scroll Bars Visible
To make scrollbars visible, set the properties that control visibility to true.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Displaying the vertical scroll bar | |
gridDesktop1.IsVerticalScrollBarVisible = true; | |
// Displaying the horizontal scroll bar | |
gridDesktop1.IsHorizontalScrollBarVisible = true; |