Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub backblue(ByVal frm As Form, ByVal boxname As String)
- For i = 1 To 3
- CType(frm.Controls(boxname & i.ToString()), TextBox).BackColor = Color.LightBlue
- Next
- End Sub
- Private Sub Button1_click and bla bla....
- backblue(Me, "txb1_")
- End Sub
- Public Sub backblue(ByVal frm As Form, ByVal prefix As String)
- For i = 1 To 3
- Dim bxName as String = prefix & i.ToString()
- Dim bx as TextBox = CType(frm.Controls(bxName), TextBox)
- If bx Is Nothing Then
- MsgBox("Unable to find text box " +bxName)
- Dim mtch() As Control = frm.Controls.Find(bxName, true)
- If mtch.Length> 0 then
- bx = mtch(0)
- Else
- Continue For
- End if
- End If
- Bx.BackColor = Color.LightBlue
- Next
- End Sub
- For Each box as Textbox In frm.Controls
- box.BackColor = Color.LightBlue
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement