繁体   English   中英

VB.NET-如果不是Datagridview单元为空

[英]VB.NET - If not Datagridview cell empty

成绩簿-我有5个单元格(Homeworks,Ex1,Ex2,Ex3,FinalExam)填写Datagridview,我的应用程序使用普通数字,但是当用户在单元格中输入“ 0”时,则不会显示成绩。 (不是总和)。 这里是我的源代码示例:

 Total = Val(HW + Ex1 + Ex2 + Ex3 + FinalEx) / 5
If Not (DataGridView1.Rows(i).Cells(2).Value) = String.Empty And
        (DataGridView1(i).Cells(3).Value) And (DataGridView1(i).Cells(4).Value) And
        (DataGridView1.Rows(i).Cells(5).Value) And (DataGridView1.Rows(i).Cells(6).Value) Then
            If Total >= 90 Then
                DataGridView1(i).Cells(7).Value = "A"

您是说然后输入全0吗? 我只看到平均分数高于90的成绩。是否有更多的80至90之间的代码? 如果他们得分100,100,100,100,0,那就是400/5或80。您对80以下的值有评分吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM