假设3个文本框:
Private Sub Text1_GotFocus()
Text1.BackColor = vbRed
Text2.BackColor = vbWhite
Text3.BackColor = vbWhite
End Sub
Private Sub Text2_GotFocus()
Text1.BackColor = vbWhite
Text2.BackColor = vbRed
Text3.BackColor = vbWhite
End Sub
Private Sub Text3_GotFocus()
Text1.BackColor = vbWhite
Text2.BackColor = vbWhite
Text3.BackColor = vbRed
End Sub