Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.NET datagridview中的每x行数_Vb.net_Loops_Datagridview - Fatal编程技术网

VB.NET datagridview中的每x行数

VB.NET datagridview中的每x行数,vb.net,loops,datagridview,Vb.net,Loops,Datagridview,我一直在网上冲浪,但找不到我想要的答案 使用VB.net,我有一个datagridview,我希望能够对存在的每一行执行一个操作 因此,假设我有一个按钮,如果单击它,vb.net会计算datagrid的行数,对于它遇到的每一行,我希望MsgBox(“还有五行”)成为apear 假设有12行,那么这是我的mesagebox的2倍,但是还有两行,在这种情况下,我想要一个msgbox,上面写着msgbox(“找到的剩余行”) 有人知道怎么做吗 Dim Count As Integer = 1

我一直在网上冲浪,但找不到我想要的答案

使用VB.net,我有一个datagridview,我希望能够对存在的每一行执行一个操作

因此,假设我有一个按钮,如果单击它,vb.net会计算datagrid的行数,对于它遇到的每一行,我希望MsgBox(“还有五行”)成为apear

假设有12行,那么这是我的mesagebox的2倍,但是还有两行,在这种情况下,我想要一个msgbox,上面写着msgbox(“找到的剩余行”)

有人知道怎么做吗

    Dim Count As Integer = 1

    For i As Integer = 0 To DataGridView.Rows.Count - 1

        If Count = 5 Then
            MsgBox("there goes another five rows")
            Count = 0
        End If

        Count += 1
    Next
    MsgBox(Count & "remaining rows found")