单项选择题
程序段如下,当发生Form_Click事件时,窗体上输出的结果是( )。
Option Explicit
Private x As Integer
Public y As Integer
Sub Test()
Dim y as integer
x=2:y=2
Print"x1=";x;"y1=";y
End Sub
Private Sub Form_Click()
x=1:y=1
Test
Print "X2=";x;"y2=";y
End Sub
A.x1=2 y1=2
x2=2 y2=1
B.x1=2 y1=2
x2=2 y2=2
C.x1=2 y1=1
x2=2 y2=2
D.x1=2 y1=1
x2=2 y2=1
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
当Form1_Click事件发生时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer Dim k As Integer,a(5,5)As Integer For i=1 To 5 k=1 For j=1 To 5 If i<=j Then a(i,j)=k k=k+1 Else a(i,j)=1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End Sub
A.1 2 3 4 5
B.1 1 2 3 4
C.1 1 1 2 3
D.1 1 1 1 2
点击查看答案&解析
单项选择题
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Function fun(x As Integer,y As Integer) Static m As Integer Static i As Integer i=i+2 i=i+m+1 m=i+x+y fun=m End Function Private Sub Command1_Click() Dim j As Integer,m As Integer,k As Integer j=4:m=1 k=fun(j,m) Print k; k=fun (j,m) Print k End Sub
A.8 18
B.7 17
C.7 19
D.8 19
点击查看答案&解析
相关试题
随机生成的10个两位数,求出它们的总和和...
下列程序实现的功能是:当在窗体上单击时,...
假设窗体中已经有了一个驱动器列表框Drivel...
以下程序的功能是每隔一定的时间在窗体的文...
图片按钮的 【6】 属性用来设置命令按钮...