调整GridWeb及其标题栏大小

更改Aspose.Cells.GridWeb的宽度和高度

更改Aspose.Cells.GridWeb控件的宽度和高度是一个简单但重要的功能。Aspose.Cells.GridWeb控件在API中由GridWeb类表示。要调整GridWeb控件的宽度和高度,只需使用其width和height属性。

以下是代码片段的输出结果。

更改了GridWeb控件的宽度和高度

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Setting the height of GridWeb control
GridWeb1.Height = new Unit(200, UnitType.Point);
// Setting the width of GridWeb control
GridWeb1.Width = new Unit(520, UnitType.Point);

更改标题栏的宽度和高度

Aspose.Cells.GridWeb控件包含以下两个标题栏:

  • 顶部标题栏,该标题栏表示A,B,C,D等列。
  • 左侧标题栏,该标题栏表示1,2,3,4等行。

下面显示了这两个标题栏。

标题栏

todo:image_alt_text

使用GridWeb控件的HeaderBarHeight和HeaderBarWidth属性分别更改顶部标题栏和左侧标题栏的高度和宽度。下图显示了以下代码示例的输出。

更改了标题栏的宽度和高度

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Setting the height of header bar
GridWeb1.HeaderBarHeight = new Unit(35, UnitType.Point);
// Setting the width of header bar
GridWeb1.HeaderBarWidth = new Unit(50, UnitType.Point);