(27)窗体上有两个文本框Text1、Text2以及一个命令按钮Commandl,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1Text=p2(p1(x),y) Text2Text=p1(x) End Sub Private Function pl(x As Integer) As Integer x=x+y:y=x+y pl=x+y End Function Private Function p2(x As Integer,By Val y As Integer) p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为 A.2 4 2 4 B.2 44 8C.4 4 8 8 D.10 1058 58
第1题:
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x=2
Text1.Text=p2(p1(x),y)
Text2.Text=p1(x)
End Sub
Private Function p1(x As Integer)As Integer
x=x+y:y=x+y
p1=x+y
End Function
Private Function p2(x As Integer,y As Integer)As Integer
p2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A.2 4 2 4
B.2 4 4 8
C.4 4 8 8
D.10 10 58 58
第2题:
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x=2
Text1.Text=Fun2(Funl(x),y)
Text2.Text=Funl(x)
End Sub
Private Function Funl(x As Integer) As Integer
x=x+y ∶y=x+y
Funl=x+y
End Function
Private Function Fun2(x As Integer,y As Integer) As Integer
Fun2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别是
A.2 4 2 4
B.2 4 4 8
C.10 10 58 58
D.4 4 8 8
第3题:
在窗体中绘制两个文本框和一个命令按钮,然后在命令按钮的代码窗口中编写如下事件过程:
Private Sub Command1_Click()
Text1="VB programming"
Text2=Text1
Text1="ABCD"
End Sub
程序运行后,单击命令按钮,文本框Text2中显示的内容为【 】。
第4题:
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序: Dim y As IntegerPrivate Sub Command1_Click()Dim x As Integer x=2 Text1.Text=p2(p1(x), y) Text2.Text=pi(x)End SubPrivate Function p1(x As Integer) As Integer x=x+y:y=x+y p1=x+yEnd FunctionPrivate Function p2(x As Integer, y As Integer) As Integer p2=2*x+yEnd Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A.2 4 2 4
B.2 4 4 8
C.4 4 8 8
D.10 10 58 58
第5题:
窗体上有两个文本框Text1、Text2以及一个命令按钮Comanand1,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1.Text = p2(p1(x), y) Text2.Text = p1(x) End Sub Private Function p1(x As Integer) As Integer x=x+y:y=x+y p1=x+y End Function Private Function p2(x As Integer, y As Integer) As Integer p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A.2 4 2 4
B.2 4 4 8
C.4 4 8 8
D.10 10 58 58