セルのフォントと色を変更する
Contents
[
Hide
]
このトピックでは、GridDesktopのセルでフォントとフォントの色を変更することについて説明します。この機能を使用すると、開発者はワークシートの詳細な制御を提供します。この機能を使用すると、開発者は任意のセルのフォントと色をカスタマイズすることができます。
セルのフォントと色を変更する
Aspose.Cells.GridDesktopを使用してセルのフォントと色を変更するには、以下の手順に従ってください:
- 任意の Worksheet にアクセスします
- フォントと色を変更するセルにアクセス
- カスタムの フォント を作成
- セルのフォントをカスタマイズされたものに設定
- 最後に、セルのフォントの色を任意の色に設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Accessing the worksheet of the Grid that is currently active | |
Worksheet sheet = gridDesktop1.GetActiveWorksheet(); | |
// Accessing a cell using its name | |
GridCell cell = sheet.Cells["A1"]; | |
// Creating a customized Font object | |
Font font = new Font("Arial", 10, FontStyle.Bold); | |
// Setting the font of the cell to the customized Font object | |
cell.SetFont(font); | |
// Setting the font color of the cell to Blue | |
cell.SetFontColor(Color.Blue); |
セルのフォントまたはフォントの色に関する情報のみが必要な場合は、セルのGetFontおよびGetFontColorメソッドも使用できます。