怎么在VB中求和
我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下Subop()T1.Enabled=TrueT1.Visible=TrueT1.SetFoc...
我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下
Sub op()
T1.Enabled = True
T1.Visible = True
T1.SetFocus
End Sub
Sub oi()
T1.Enabled = False
T1.Visible = False
End Sub
Private Sub Command1_Click()
)
ElseIf O7 Then
T5 = Tan(T3 * 3.141592653 / 180)
ElseIf O8 Then
T5 = 1 / Tan(T3 * 3.141592653 / 180)
ElseIf O9 Then
If T3 < 0 Then
MsgBox "被开方数不能小于零", 2 + vbExclamation, "错误"
T3 = ""
T3.SetFocus
Exit Sub
End If
T5 = Sqr(T3)
ElseIf O10 Then
T5 = Abs(T3)
ElseIf O11 Then
T5 = Exp(T3)
ElseIf O12 Then
If T3 <= 0 Then
T3 = ""
T3.SetFocus
End If
T5 = Log(T3)
ElseIf O13 Then O13是求和按钮,这里怎么编才能使我一按下o13就可一出现,,,,
Dim a!(), sum!,n%
n =inputbox("")
For i = 0 To UBound(a) - 1
T5 = T + Array(i)
Next i
End If
End Sub 展开
Sub op()
T1.Enabled = True
T1.Visible = True
T1.SetFocus
End Sub
Sub oi()
T1.Enabled = False
T1.Visible = False
End Sub
Private Sub Command1_Click()
)
ElseIf O7 Then
T5 = Tan(T3 * 3.141592653 / 180)
ElseIf O8 Then
T5 = 1 / Tan(T3 * 3.141592653 / 180)
ElseIf O9 Then
If T3 < 0 Then
MsgBox "被开方数不能小于零", 2 + vbExclamation, "错误"
T3 = ""
T3.SetFocus
Exit Sub
End If
T5 = Sqr(T3)
ElseIf O10 Then
T5 = Abs(T3)
ElseIf O11 Then
T5 = Exp(T3)
ElseIf O12 Then
If T3 <= 0 Then
T3 = ""
T3.SetFocus
End If
T5 = Log(T3)
ElseIf O13 Then O13是求和按钮,这里怎么编才能使我一按下o13就可一出现,,,,
Dim a!(), sum!,n%
n =inputbox("")
For i = 0 To UBound(a) - 1
T5 = T + Array(i)
Next i
End If
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询