## GridCell.GetStyle method

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

```csharp
public Style GetStyle()
```

### 返回值

返回单元格样式的副本。

### 例子

```csharp
[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)

```

### 也可以看看

* class [Style](../../../aspose.cells.griddesktop/style)
* class [GridCell](../../gridcell)
* 命名空间 [Aspose.Cells.GridDesktop.Data](../../gridcell)
* 部件 [Aspose.Cells.GridDesktop](../../../)

<!-- DO NOT EDIT: generated by xmldocmd for Aspose.Cells.GridDesktop.dll -->
