vb加、乘法代码

来源:百度知道 编辑:UC知道 时间:2024/05/15 08:00:46
text1,text2 text3 text4
text1输入数字a
text2输出{a*a*a*15+(a*a*1000+20000)}
text3输出{a*a*a*45+(a*a*2800+20000)}
text4输出text2+text3
求这个简单代码,谢谢

Private Sub Command1_Click()
Dim a
a = Text1.Text
If Not IsNumeric(a) Then
MsgBox "请输入数字"
Exit Sub
End If
Text2.Text = a * a * a * 15 + (a * a * 1000 + 20000)
Text3.Text = a * a * a * 45 + (a * a * 2800 + 20000)
Text4.Text = Text2.Text + Text3.Text
End Sub

Private Sub Command1_Click()
Dim a As Double
a = Val(Text1)
Text2 = (a * a * a * 15 + (a * a * 1000 + 20000))
Text3 = (a * a * a * 45 + (a * a * 2800 + 20000))
Text4 = Val(Text3) + Val(Text2)
End Sub

Private Sub Form_Load()
Text1 = "": Text2 = "": Text3 = "": Text4 = ""
End Sub

<input name="text1" onblur="calc()"><br>
<input name="text2"><br>
<input name="text3"><br>
<input name="text4"><br>
<script>
function calc(){
text1value=document