帮我做个长方形求面积的工程:
要求,利用子过程完成。
界面要:
帮我做个长方形求面积的工程:
要求,利用子过程完成。
界面要:
子工程:
Option Explicit
Dim s!
Sub a(ByVal m!, ByVal n!)
s = m * n
End Sub
Private Sub Command1_Click()
Call a(Text1, Text2)
Text3 = s
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
这个很简单啊
private sub form1_load()
text1.text=""
text2.text=""
text3.text=""
end sub
private sub command1_click()
dim a as singer,b as singer,n as singer 'a 为长,b为款,n为面积,N也可以定义为双精度
a=val(text1.text) '将text1中的数据转换为数值赋值给a
b=val(text1.text) '将text2中的数据转换为数值赋值给B
n=a*b '将a和b的乘积赋值给n,也就是n=长*宽
text3.text=n '将计算结果赋值给text3
end sub
private sub command2_click()
end
end sub
Private Sub Command1_Click() '确定 Label4.Caption = Val(Text1.Text) * Val(Text2.Text) End Sub
Private Sub Command2_Click() '清空 Text1.Text = "" Text2.Text = "" Label4.Caption = "" End Sub
欢迎加我的QQ:9986666@qq.tm 一起交流以,答案是110
Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = Text1.Text b = Text2.Text Text1.Text = "" Text2.Text = "" Text3.Text = a * b
End Sub
Private Sub Command2_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub
//这是代码 界面就和你那个一样