<分区>
我正在制作一个库存系统,如果它低于 10,它会每 3 秒检查单元格 5 中的行。然后我的问题是如何将颜色更改为红色以显示低于 10 的行。
private void belowstock()
{
int row;
int qty, qtyOnHand;
for (row = 0; row < dataGridView1.RowCount; row++)
{
qty = int.Parse(dataGridView1.Rows[row].Cells[5].Value.ToString());
qtyOnHand = 10;
if (qty <= qtyOnHand)
{
//red
}
else
//white
}
}