怎么在VB中求和我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下Sub op()T1.Enabled = TrueT1.Visible = TrueT1.SetFocusEnd SubSub oi()T1.Enabled = FalseT1.Visible = FalseEnd SubPrivate
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 11:35:20
怎么在VB中求和我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下Sub op()T1.Enabled = TrueT1.Visible = TrueT1.SetFocusEnd SubSub oi()T1.Enabled = FalseT1.Visible = FalseEnd SubPrivate
怎么在VB中求和
我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下
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
怎么在VB中求和我是想编一个简单计算器,编到求和这块不太会了,下面是我写的代码,麻烦帮我想一下Sub op()T1.Enabled = TrueT1.Visible = TrueT1.SetFocusEnd SubSub oi()T1.Enabled = FalseT1.Visible = FalseEnd SubPrivate
你的问题不够具体…那么我给你一个例子,你参考下:
Private Sub Form_Load()
Dim a(1 To 50)
Show
For i=1 To 50
a(i)=101*RND
sum=sum+a(i)
Next i
Print sum
End Sub
以上希望能给你帮助,求和主要是用到循环,可以用For和Do.