窗体上有两个文本框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
第1题:
在窗体(Name属性为Form1)上画两个文本框(其Name属性分别为Text1和Text2)和一个命令按钮(Name属性为Command1),然后编写如下两个事件过程: 程序运行后,在第一个文本框(Text1)和第二个文本框(Text2)中分别输入“同学们,”和“你们好”,然后单击命令按钮,则输出结果为多少?
程序运行后,在第一个文本框(Text1)和第二个文本框(Text2)中分别输入“同学们,”和“你们好”,然后单击命令按钮,则输出结果为:同学们,你们好。
略
第2题:
在窗体中绘制两个文本框和一个命令按钮,然后在命令按钮的代码窗口中编写如下事件过程:
Private Sub Command1_Click()
Text1="VB programming"
Text2=Text1
Text1="ABCD"
End Sub
程序运行后,单击命令按钮,文本框Text2中显示的内容为【 】。
第3题:
窗体上有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
第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以及一个命令按钮Command1,编写下列程序:
DimY 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+v: 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
第6题:
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x=2
Text1.Text=Fun2(Fun1(x),y)
Text2.Text=Fun1(x)
End Sub
Private Function Fun1(x As Integer) As Integer
x=x+y:y=x+y
Fun1=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
第7题:
在窗体上画两个文本框和一个命令按钮,然后在命令按钮的代码窗口中编写如下事件过程:
Private Sub Command1_Click()
Text 1="VB programming"
Text 2=Text 1
Text 1="ABCD"
End Sub
程序运行后,单击命令按钮,文本框Text 2中显示的内容为【 】。
第8题:
(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
第9题:
在窗体中有两个文本框分别为 text1 和 text2 ,一个命令按钮 command1, 编写如下两个事件过程:
Private sub command1_click()
A=text1.value+text2.value
Msgbox a
End sub
Private sub form_load()
Text1.value= ””
Text2.value= ””
End sub
程序运行时,在文本框 text1 中 78 ,在文本框 text2 中输入 87 ,单击命令按钮,消息框中输出的结果为____ 11 ___