Public Class search_room
Private Sub btn_back_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_back.Click
Me.Hide()
FacStu.Opacity = 1
End Sub
Private Sub btn_delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_delete.Click
searchDGV(tbx_finder.Text)
FacStu.Opacity = 1
Me.Hide()
End Sub
Sub searchDGV(ByVal selSearch As String)
With FacStu.DataGridView1
Dim iTemp As Integer = 1
If Login.DataGridView1.AllowUserToAddRows Then iTemp = 2 '// check if extra row or not, at bottom of dgv.
For i As Integer = 0 To .Rows.Count - iTemp '// loop thru all rows.
For x As Integer = 0 To .Columns.Count - 1 '// loop thru all columns in a row.
If Login.DataGridView1.Item(x, i).Value = selSearch Then '// locate your search.
Login.DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.Lime
End If
Next
Next
End With
End Sub
End Class
that my code? when i run nothings happen?

New Topic/Question
Reply



MultiQuote




|