回答:如何让文本框的字变色
自己做了一个很简单 用TIMER控件来控制文本的颜色
附件上传不了 我直接贴代码得了
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
Text1.ForeColor = vbBlack
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = False
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 500
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = False
End Sub
Private Sub Timer1_Timer()
Static i As Integer
Dim j As Integer
i = i + 1
j = i Mod 5
Select Case j
Case 0
Text1.ForeColor = RGB(145, 85, 147)
Case 1
Text1.ForeColor = vbRed
Case 2
Text1.ForeColor = vbBlue
Case 3
Text1.ForeColor = vbYellow
Case 4
Text1.ForeColor = RGB(36, 241, 75)
End Select
End Sub