gpt4 book ai didi

c# - Datagridview 行改变颜色

转载 作者:行者123 更新时间:2023-11-30 14:30:57 28 4
gpt4 key购买 nike

<分区>

我正在制作一个库存系统,如果它低于 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
}
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com