level 8
tbzp666
楼主

问题是:当文本框text1的enabled属性设置为False时,我对“字体”、“字号”进行编写代码时正常但对字体颜色编写时,文本框不起作用(不改变颜色)
当文本框text1的enabled属性设置为True时,能改变颜色
编写代码如下:
Rem 选择字体
Private Sub Option1_Click(Index As Integer)
Text1.FontName = Option1(Index).Caption
End Sub
Rem 选择字号
Private Sub Option2_Click(Index As Integer)
Text1.FontSize = Option2(Index).Caption
End Sub
Rem 选择字体颜色
Private Sub Option3_Click(Index As Integer)
Select Case Index
Case 0
Text1.ForeColor = vbRed
Case 1
Text1.ForeColor = vbGreen
Case 2
Text1.ForeColor = vbBlue
Case 3
Text1.ForeColor = vbYellow
End Select
End Sub
请大佬们解释为什么?