GetStyle

GridCell.GetStyle method

获取单元格样式。 更改样式时,应调用“SetStyle”方法, 为单元格设置样式。

public Style GetStyle()

返回值

返回单元格样式的副本。

例子

[C#]
Style style = sheet.GetCell(0, 0).GetStyle();
style.CellLocked = true;
style.VAlignment = VerticalAlignmentType.Top;
...
sheet.GetCell(0, 0).SetStyle(style);

[Visual Basic]
Dim style As Style =  sheet.GetCell(0,0).GetStyle() 
style.CellLocked = True
style.VAlignment = VerticalAlignmentType.Top
...
sheet.GetCell(0, 0).SetStyle(style)

也可以看看