using NPOI.HSSF.Util;
using NPOI.SS.UserModel
dgv.Rows[i].Cells[j].Style.ForeColor = Color.Red
if (dgv.Rows[i].Cells[j].Style.ForeColor == Color.Red)
{
// 设置文本颜色
HSSFColor myColor = new HSSFColor.Red(); // 使用预定义的颜色
HSSFFont font = (HSSFFont)wb.CreateFont();
font.Color = myColor.Indexed;
style.SetFont(font);
}
11-11
1551
03-14
2273