Dim a As String a = Text1.Text Text1.Text = Text2.Text Text2.Text = a
End Sub
Private Sub Text1_Change() Text1.BackColor = vbBlack Text1.ForeColor = vbRed End Sub
Private Sub Text2_Change() Text2.BackColor = vbBlack Text2.ForeColor = vbWhite End Sub
方法二:
Private Sub 变换_Click() Dim a As String a = Me.Label1.Caption Me.Label1.Caption = Me.Label2.Caption Me.Label2.Caption = a Dim b As String b = Me.Label1.ForeColor Me.Label1.ForeColor = Me.Label2.ForeColor Me.Label2.ForeColor = b