【问题标题】:VB.NET - If not Datagridview cell emptyVB.NET - 如果不是 Datagridview 单元格为空
【发布时间】:2014-04-30 03:09:16
【问题描述】:

成绩簿 - 我有 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"

【问题讨论】:

    标签: c# vb.net visual-studio visual-studio-2012 datagridview


    【解决方案1】:

    你的意思是输入全 0 吗?我只看到平均分高于 90 的成绩。 80到90之间有更多代码吗? 如果他们得分 100,100,100,100,0 那是 400/5 或 80。 你有80以下的分数吗?

    【讨论】:

    • 是的,如果我想输入全 0 则 IF 不起作用。 (不是总和)另外,如果我只输入一个“0”。 (不是总和)。是的,我有一个价值低于 80. 70. 60. 等的条件......
    • 你能显示其余的 if 条件吗?也许这就是问题所在?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多