VB 单选按扭optionbutton实现一种功能

2024-12-16 13:38:18
推荐回答(4个)
回答1:

Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0
Text1.FontItalic = True
Text1.FontBold = False
Text1.FontUnderline = False
Case 1
Text1.FontItalic = False
Text1.FontBold = True
Text1.FontUnderline = False
Case 2
Text1.FontItalic = False
Text1.FontBold = False
Text1.FontUnderline = True
End Select
End Sub

回答2:

Private Sub Option1_Click(Index As Integer)
Text1.FontItalic = Option1(0).value
Text1.FontBold = Option1(1).value
Text1.FontUnderline =Option1(2).value
end sub

回答3:

Select Case Index
Case 0
Text1.FontItalic = True
Case 1
Text1.FontBold = True
Case 2
Text1.FontUnderline = True
End Select

回答4:

mm