Modifica del carattere e del colore di un Cell

Modifica del carattere e del colore di un Cell

Per modificare il carattere e il colore di una cella utilizzando Aspose.Cells.GridDesktop, procedi nel seguente modo:

  • Accedi a qualsiasi desideratoFoglio di lavoro
  • Accedi aCell il cui carattere e colore devono essere modificati
  • Crea un file personalizzatoFont
  • Impostare ilFont delCell a quello personalizzato
  • Finalmente, setColore del carattere delCell a qualsiasi desideratoColore
// 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);