显示和隐藏滚动条
Contents
[
Hide
]
滚动条对于导航宽阔或深层的电子表格内容非常有用,即具有许多行和列的内容。大多数应用程序支持两种类型的滚动条:
- 垂直滚动条
- 水平滚动条
这两者都可以在Microsoft Excel中找到。
Aspose.Cell的GridDesktop API为浏览工作表内容提供了水平和垂直滚动条。使用Aspose.Cells.GridDesktop API,开发人员可以控制这两种滚动条的可见性。
控制滚动条的可见性
要在GridDesktop中控制滚动条的可见性,使用IsVerticalScrollBarVisible和IsHorizontalScrollBarVisible属性。下面的示例显示了如何隐藏和显示滚动条。
编程示例:隐藏滚动条
要隐藏滚动条,将控制可见性的属性设置为false。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
编程示例:使滚动条可见
要使滚动条可见,请将控制可见性的属性设置为true。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |