Finding text from the datagrid view in vb.net

后端 未结 3 1202
醉酒成梦
醉酒成梦 2021-01-21 09:58

I have a data grid view in one windows form named \"GridViewForm\". When the user search for the text from the search box from another window form named \"FindForm\", I want to

3条回答
  •  Happy的楠姐
    2021-01-21 10:27

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
    
     For Each dr As DataGridViewRow In Me.DataGridView1.Rows
    
                If dr.Cells(0).Value.ToString.Contains(TextBox2.Text) Then dr.Visible = True Else dr.Visible = False
    
    
            Next
        End Sub
    

提交回复
热议问题