有如下Sub过程:
Sub ind(a As Integer)
Static x As Integer
x= x + a
Print x:
End Sub
以下是调用它的事件过程,程序运行后,单击命令按纽Command1三次,输出结果为【 】。
Private Sub Command1_Click()
Ind 2
End Sub
第1题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub subl(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) z=x*x+y*y End Sub Private Sub Command1_Click() Dim a As Integer a=8 Call subl(1, 2,a) Print a End Sub 程序运行后,单击命令按钮,则窗体下显示的内容是______。
A.8
B.2
C.5
D.11
第2题:
要求当鼠标在图片框P1中移动时,立即在图片框中显示鼠标的位置坐标。下面能正确实现上述功能的事件过程是
A.Private Sub P1_MouseMove(Button As Integer,Shift As Integer,x As Single,Y As Single) Print X,Y End Sub
B.Private Sub P1_M0useDown(Button As Integer,Shift As Integer,X As Single,Y As Single) Picture.Print X,Y End Sub
C.Private Sub P1_MouscMove(Button As integer,Shift As Integer,X As Single,Y As Single) P1.Print X.Y End Sub
D.Private Sub Form_MouseMove(Button As Integer,Shift As Integer,x As Single,Y As Single) P1.Print X.Y End Sub
第3题:
执行下列程序后,鼠标单击窗体,输出结果为 。
Private Sub Form_Click()
Print "Click";
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift _
As Integer, X As Single, Y As Single)
Print "Donw"
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift _
As Integer, X As Single, Y As Single)
Print " Up"
End Sub( )。
A.DownUpClick
B.ClickDownUp
C.DownClickUp
D.UpDownClick
第4题:
有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。
A.12
B.24
C.36
D.48
第5题:
单击按钮时,以下程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=x+y End Sub Private Sub Command1_Click() Dim x As Integer,y As Integer,Z As Integer x=1:y=2:z=3 Call proc1(x,x,z) Print x;x;z Call proc1(x,y,y) Print x;y;y End Sub
A.6 6 12 `
B.9 5 10 6101051010
C.9 6 12
D.9 10 10 910155410
第6题:
对窗体编写如下事件过程: Private Sub Form_ MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If Button =2 Then Print “AAAAA” End If End Sub Private Sub Form_ MouseUp (Button As Integer,Shift As Integer,X As Single,Y As Single) Print “BBBBB” End Sub 程序运行后,如果单击鼠标右键,则输出结果为______ 。
A.AAAAA BBBBB
B.BBBBB
C.AAAAA
D.BBBBB AAAAA
第7题:
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。
A.6, 8
B.10, 10
C.10, 8
D.6, 10
第8题:
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x=20 y=2 f=x*y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x; y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是______。
A.10 5
B.20 5
C.20 40
D.10 40
第9题:
有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m &"*”:n=n&"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * #
B.1 1 * #
C.1 1 * # 1 1 * # 1 2 * #
D.1 1 * # 1 1 * ## 1 2 * ##
第10题:
在窗体上画一个命令按钮,然后编写下列程序: Private Sub Command12_Click() Tt 3 End Sub Sub Tt(a As Integer) Static X As Integer X=X * a + 1 Print x; End Sub 连续三次单击命令按钮,输出的结果是
A.1 5 8
B.1 4 13
C.3 7 4
D.2 4 8