|
上傳源碼,大家自行研究好了
如下:
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
Private Sub Form_Load()
Text1.Text = "1"
Text2.Text = "1"
Text3.Text = "1"
End Sub
|
|