各位懂VB的大师,我有一个很简单的问题要向你们请教啊~~help me!!
应该使用数组控件,如图:
Private Sub Check1_Click(Index As Integer)
If Check1(0).Value = 1 Then
Text1.FontBold = True
Else
Text1.FontBold = False
End If
If Check1(1).Value = 1 Then
Text1.FontItalic = True
Else
Text1.FontItalic = False
End If
If Check1(2).Value = 1 Then
Text1.FontUnderline = True
Else
Text1.FontUnderline = False
End If
End Sub
Private Sub Command1_Click()
Call Form_Load
End Sub
Private Sub Form_Load()
For i = 0 To 2
Option1(i).Value = False
Option2(i).Value = False
Check1(i).Value = 0
Next i
Text1.Font = "宋体"
Text1.ForeColor = &H0
End Sub
Private Sub Option1_Click(Index As Integer)
If Option1(0).Value = True Then
Text1.Font = "宋体"
ElseIf Option1(1).Value = True Then
Text1.Font = "黑体"
ElseIf Option1(2).Value = True Then
Text1.Font = "幼圆"
End If
End Sub
Private Sub Option2_Click(Index As Integer)
If Option2(0).Value = True Then
Text1.ForeColor = vbRed
ElseIf Option2(1).Value = True Then
Text1.ForeColor = vbGreen
ElseIf Option2(2).Value = True Then
Text1.ForeColor = vbYellow
End If
End Sub
2024-09-19 广告
Text1.ForeColor = vbRed
End Sub
'这样就行了
2、童鞋,你的true拼写错误了,有反应就出鬼了
3、字体颜色是fontcolor属性
我已经不忍心看了
PS:下次记得放分,不然没几个人愿意回答的