一个很简单的程序编辑问题
大家帮我看看这个程序有什么问题
这个程序我就是运行不了
Private Sub Command1_click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command2_Click()
a = Vall(Text1.Text)
b = Vall(Text2.Text)
Text3.Text = a * b
End Sub
Private Sub Form_Load()
End Sub
参考答案:你是想实现这个吧?
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim a As Double
Dim b As Double
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
TextBox3.Text = (a * b).ToString()
End Sub
End Class