问题描述
美好的一天。
我有一个数据库,其中包含一个名为License_Expiration的表字段,其中包含日期,我将在VB.NET中显示datagridview
现在我想问一下如何使用以下条件更改Datagridview Rows Colors。
1.如果License_Expiration将在当前到期日期前一个月到期,那么行将以深绿色变化。
2.如果License_Expiration将在到期前10天到期,则颜色为浅绿色
3.如果License_Expiration符合当前日期,那么它将转向红色
4.如果License_Expiration日期已过,那么它将变为黄色。
请帮助:(
Good Day to all.
I have a database which has a table field called "License_Expiration" that contains date and I will show this in a VB.NET datagridview
Now i just wanna ask How to change Datagridview Rows Colors by using the conditions below.
1.If License_Expiration will expire a month before the current date of expiration then the rows will change in dark green.
2.If License_Expiration will expire 10 days before the expiration then the color is light green
3.If License_Expiration meets the current date then it will turn red
4.If License_Expiration date has passed then it will turn yellow.
Please do help :(
推荐答案
private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
}
问候。 。:笑:
Regards.. :laugh:
这篇关于VB.NET DATAGRID VIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!