簡體   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