有如下VB程序段: Private Sub Command1_Click() Dim a As Long a=Val(Text1.Text) Print a End Sub 其中"Private Sub Command1_Click()"的作用是()。
第1题:
(10)在窗体上画一个文本框和一个图片框,然后编写下列两个事件过程: Private Sub Form_Click() Text1.Text="VB Programming" End Sub Private Sub Text1_Change() Picture1.Print"VB程序设计" End Sub 程序运行后,单击窗体,则在文本框中显示的内容是,而在图片框中显示的内容是 。
第2题:
在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_ Click ( ) x = InputBox("Enter the First integer") y = InputBox("Enter the Second integer") Print y +xEnd Sub程序运行后,单击命令按钮,先后在两个输入对话框中分别输入456和123,则输出结果是 ______。
A.579
B.123
C.456
D.123456
第3题:
在窗体上画一个文本框和一个图片框,然后编写如下两个事件过程:
Private Sub Form_Click()
Text1.Text = "VB程序设计"
End Sub
Private Sub Text1_Change()
Picture1.Print "VB Programming"
End Sub
程序运行后,单击窗体,则在文本框中显示的内容是______,而在图片框中显示的内容是_____。
VB程序设计 VB Programming
第4题:
下列程序的执行结果为______。Private sub Command1_ Click ( ) a = 100 b = 50 if a <> b then a = a + b Else b = b -a Print a, bEnd Sub
A.50 50
B.150 50
C.200 200
D.10 10
第5题:
在窗体中添加一个命令按钮,并编写如下程序:Private Sub Command1_ Click() x=1: y=2: z=3 x=y: y=z: z=xEnd Sub程序执行后,输出的结果是______。
A.3
B.0
C.2
D.1
第6题:
下列程序输出的结果为【 】。
Private Sub Commandl_Click( )
Dim a As Boolean
a = True
If a Then GoTo 11 Else GoTo 22
11:
Print "VB";
22:
Print "VC"
End Sub
第7题:
设程序中有如下数组定义和过程调用语句: Dim a(10)As Integer … Call D(a) 如下过程定义巾,正确的是( )。
A.Private Sub p(a As Integer)
B.Private Sub p(a( )As Integer)
C.Private Sub p(a(10)As Integer)
D.Private Sub p(a(n)As Integer)
第8题:
有弹出式菜单的结构如下表,程序运行时,单击窗体则弹出如下图所示的菜单。下面的事件过程中能正确实现这一功能的是( )。
A.Private Sub Form_Click() PopupMenu cut End Sub
B.Private Sub Command1_Click() PopupMenu edit End Sub
C.Private Sub Form_Click() PopupMenu edit End Sub
D.Private Sub Form_Click() PopupMenu cut End Sub
第9题:
在窗体上画一个命令按钮,名称为Command1,然后编写如下程序:Private Sub Command1_ Click()Dim a As Integer, b As Integerdo while b <100 b=b+5 a=a+ b if b >20 then exit doLoopPrint a, bEnd Sub程序运行后,如果甲击命令按钮,则在窗体上显示的内容是______。
A.50 20
B.75 25
C.50 25
D.75 20
第10题:
下列程序的功能是:当x<50时,y =0.8 xx;当50≤x≤100时,y=0.7 xx;当x>100时,
Private Sub Command1_Click()
Dim x As Single
x = InputBox("请输入x的值" )
Select Case x
Case Is<50
y=0.8 * x
Case 50 To 100
y=0.7 * x
【 】
Print "输入数据出界!"
End Select
Print x, y
End Sub