[]
用于在单元格中显示按钮。支持自定义按钮文本、背景色以及相对于单元格边缘的边距。可以通过 IRange.setCellType(BaseCellType) 或IWorksheet.setCellType(BaseCellType) 应用于单个单元格、区域、行、列或整个工作表。
ButtonCellType button = new ButtonCellType();
button.setText("Click Me");
button.setButtonBackColor("Azure");
button.setMarginLeft(10);
button.setMarginRight(10);
worksheet.getRange("A1").setCellType(button);
doubledoubledoubledoublegetText()voidsetButtonBackColor(String value) voidsetMarginBottom(double value) voidsetMarginLeft(double value) voidsetMarginRight(double value) voidsetMarginTop(double value) void
ButtonCellType button = new ButtonCellType();
button.setText("Submit");
String text = button.getText();
ButtonCellType button = new ButtonCellType();
button.setText("Submit");
value - 按钮的文本内容。
ButtonCellType button = new ButtonCellType();
button.setButtonBackColor("Azure");
String color = button.getButtonBackColor();
ButtonCellType button = new ButtonCellType();
button.setButtonBackColor("Azure");
value - 按钮的背景颜色。
ButtonCellType button = new ButtonCellType();
button.setMarginLeft(6);
double marginLeft = button.getMarginLeft();
ButtonCellType button = new ButtonCellType();
button.setMarginLeft(6);
value - 按钮的左边距(以像素为单位)。
ButtonCellType button = new ButtonCellType();
button.setMarginRight(6);
double marginRight = button.getMarginRight();
ButtonCellType button = new ButtonCellType();
button.setMarginRight(6);
value - 按钮的右边距(以像素为单位)。
ButtonCellType button = new ButtonCellType();
button.setMarginTop(6);
double marginTop = button.getMarginTop();
ButtonCellType button = new ButtonCellType();
button.setMarginTop(6);
value - 按钮的顶部边距,以像素为单位。
ButtonCellType button = new ButtonCellType();
button.setMarginBottom(6);
double marginBottom = button.getMarginBottom();
ButtonCellType button = new ButtonCellType();
button.setMarginBottom(6);
value - 按钮的底边距(以像素为单位)。