Cambiar la fuente y el color de una celda

Cambiar la fuente y el color de una celda

Para cambiar la fuente y el color de una celda utilizando Aspose.Cells.GridDesktop, siga los pasos a continuación:

  • Acceda a cualquier Hoja de Cálculo deseada
  • Acceda a una Celda cuya fuente y color se desean cambiar
  • Cree una Fuente personalizada
  • Establezca la Fuente de la Celda en la personalizada
  • Finalmente, establezca el Color de la Fuente de la Celda en cualquier Color deseado
// 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);