Cambiare il Font e il Colore di una Cella

Cambiare il Font & Colore di una Cella

Per cambiare il font e il colore di una cella utilizzando Aspose.Cells.GridDesktop, si prega di seguire i passaggi seguenti:

  • Accedere a qualsiasi Foglio di lavoro desiderato
  • Accedere a una Cella di cui si desidera cambiare il font e il colore
  • Creare un Font personalizzato
  • Impostare il Font della Cella a quello personalizzato
  • Infine, impostare il Colore del Font della Cella a qualsiasi Colore desiderato
// 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);