求该VB题目的编程代码
2个回答
展开全部
Private Sub Form_Load()
Label1.Caption = "X"
Label2.Caption = "Y"
Label3.Caption = "X+Y="
Label4.Caption = "X-Y="
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Command1.Caption = "计算"
End Sub
Private Sub Command1_Click()
Dim x As Integer, y As Integer, s As Integer, t As Integer
x = Val(Text1.Text)
y = Val(Text2.Text)
s = x + y
t = s - y
Text3.Text = s
Text4.Text = t
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询