標(biāo)題: 用VB寫的歐姆定律自動(dòng)計(jì)算器A1.0 [打印本頁(yè)] 作者: hts2008222 時(shí)間: 2016-4-11 23:12 標(biāo)題: 用VB寫的歐姆定律自動(dòng)計(jì)算器A1.0 用于快速計(jì)算歐姆定律的電流電壓電阻參數(shù),很方便! 作者: hts2008222 時(shí)間: 2016-4-11 23:14
有附件的,沒有上傳成功,什么情況啊?作者: hts2008222 時(shí)間: 2016-4-11 23:18
上傳源碼,大家自行研究好了
如下:
Private Sub Command1_Click()
Dim a, b, result As Double
a = Text2.Text
b = Text3.Text
result = 0
If b <> 0 Then
result = a * b
Text1.Text = result
Else
MsgBox "除數(shù)不能為零"
End If
End Sub
Private Sub Command2_Click()
Dim a, b, result As Double
a = Text1.Text
b = Text3.Text
result = 0
If b <> 0 Then
result = a / b
Text2.Text = result
Else
MsgBox "除數(shù)不能為零"
End If
End Sub
Private Sub Command3_Click()
Dim a, b, result As Double
a = Text1.Text
b = Text2.Text
result = 0
If b <> 0 Then
result = a / b
Text3.Text = result
Else
MsgBox "除數(shù)不能為零"
End If
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Command5_Click()
Text1.Text = "1"
Text2.Text = "1"
Text3.Text = "1"
End Sub