## GridCell.SetFont method

为单元格设置字体。 为提高性能，实现“SetFont”方法， 不实现“字体”属性。

```csharp
public void SetFont(Font font)
```

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| font | Font | 要设置的字体。 |

### 例子

```csharp
[C#]
GridCell cell = gridDesktop1.GetActiveWorksheet().Cells[0, 0];
Font font = new Font("Courier New", 8, FontStyle.Italic);
cell.SetFont(font);
Color color = cell.GetFontColor();
color = Color.Black;
cell.SetFontColor(color);

[Visual Basic]
Dim cell As GridCell =  gridDesktop1.GetActiveWorksheet().Cells(0, 0) 
Dim font As Font =  New Font("Courier New",8,FontStyle.Italic) 
cell.SetFont(font)
Dim color As Color =  cell.GetFontColor() 
color = Color.Black
cell.SetFontColor(color)

```

### 也可以看看

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

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