按照要求添加控件;记option1、option2 两数组控件
Dim j As Single
Const pi = 3.14159265358979
Private Sub Command1_Click()
If Option1(0).Value = True Then j = Val(Text1.Text) * pi / 180
If Option1(1).Value = True Then j = Val(Text1.Text)
If Option2(0).Value = True Then Label1.Caption = "sin" & "(" & Text1.Text & ")" & "=" & FormatNumber(Sin(j), 5, -1, , 0)
If Option2(1).Value = True Then Label1.Caption = "cos" & "(" & Text1.Text & ")" & "=" & FormatNumber(Cos(j), 5, -1, , 0)
If Option2(2).Value = True Then Label1.Caption = "tan" & "(" & Text1.Text & ")" & "=" & FormatNumber(Tan(j), 5, -1, , 0)
End Sub
Private Sub Form_Load()
Label1.Caption = ""
End Sub
Private Sub Option1_Click(Index As Integer)
Label1.Caption = ""
End Sub
Private Sub Option2_Click(Index As Integer)
Label1.Caption = ""
End Sub
Private Sub Text1_Change()
Label1.Caption = ""
End Sub
温馨提示:内容为网友见解,仅供参考