【简答题】
Private Sub Command1_Click()
For i = 0 To 3
' If ? = True Then
opt = Option1(i).Caption
End If
Next
' Select Case ?
Case "+"
Result = HScroll1.Value + HScroll2.Value
Case "-"
Result = HScroll1.Value - HScroll2.Value
Case "*"
Result = HScroll1.Value * HScroll2.Value
Case "/"
Result = HScroll1.Value / HScroll2.Value
End Select
' ? = Str(HScroll1.Value) & " " & opt & Str(HScroll2.Value) & " =" & Str(Result)
End Sub
参考答案
Private Sub Command1_Click()
For i = 0 To 3
If Option1(i) = True Then
opt = Option1(i).Caption
End If
Next
Select Case opt
Case "+"
Result = HScroll1.Value + HScroll2.Value
Case "-"
Result = HScroll1.Value - HScroll2.Value
Case "*"
Result = HScroll1.Value * HScroll2.Value
Case "/"
Result = HScroll1.Value / HScroll2.Value
End Select
Label4 = Str(HScroll1.Value) & " " & opt & Str(HScroll2.Value) & " =" & Str(Result)
End Sub