更多"有如下事件过程,单击命令按钮扣,输出结果是 Private Sub"的相关试题:
[单项选择]在窗体上画1个命令按钮,并编写如下事件过程:
Private Sub Command1_Click( )
Dim a(3, 3)
For m = 1 To 3
For n = 1 To 3
If n = m Or n = 4 - m Then
a(m, n) = m + n
Else
a(m, n) = 0
End If
Print a(m, n);
Next n
Print
Next m
End Sub
运行程序,单击命令按铡,窗体上显示的内容为( )。
A. 2 0 0
B. 2 0 4
C. 2 3 0
D. 2 0 0
[单项选择]在窗体上画一个命令按钮,并编写如下事件过程:
Private Sub Command1_Click( )
Dim a(3, 3)
For m=1 To 3
For n=1 To 3
If n=m Or n=4-m Then
a(m,n)=m+n
Else
a(m,n)=0
End If
Print a(m,n);
Next n
Print
Next m
End Sub
运行程序,单击命令按钮,窗体上显示的内容为
A. 2 0 0
B. 2 0 4
C. 2 3 0
D. 2 0 0
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
a=0
For i=1 to 2
For j=1 To 4
If j Mod 2<>0 Then
a=a+1
End If
a=a+1
Next j
Next i
MsgBox a
End Sub
程序执行后,单击命令按钮,消息框显示的是 【15】 。
[填空题]在窗体上画一个名称为“Command1”的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim a As String
a="123456789"
For i=1 To 5
Print Space(6-i);Mid$(a,______,2*i-1)
Next i
End Sub
程序运行后,单击命令按钮,窗体上的输出结果是如下,请填空。
5
456
34567
2345678
123456789
[单项选择]单击窗体上Command1命令按钮时,执行如下事件过程: Private Sub Command1_Click( ) a$= "software and hardware" b$= Right(a$, 8) c$= Mtd(b$ 1, 8) Msgbox c$ End sub则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. and
[填空题]在窗体中有一个名为Command1的命令按钮,Click事件的代码如下:
Private Sub Command1 Click( )
f=0
For n=1 To 10 Step 2
f=f+n
Next n
Me! Lb1.Caption=f
End Sub
单击命令按钮后,标签显示的结果是______。
[填空题]设有命令按钮Command1的单击事件过程,代码如下:
Private Sub Command1_Click( )
Dim a(30)As Integer
For i=1 To 30
a(i)=i
Next
For Each arrItem 【13】 a
If arrItem Mod 7=0 Then Print arrItem:
If arrItem>90 Then Exit For
Next
End Sub
请填空。
[填空题]窗体上命令按钮Command1的事件过程如下:
Private Sub Command1_Click( )
Dim total As Integer
total=s(1)+s(2)
Print total
End Sub
Private Function s(m As Integer) As Integer
Static x As Integer
For i=1 To m
x=x+1
Next i
s=x
End Function
运行程序,第三次单击命令按钮Command1时,输出结果为______。
[单项选择]在窗体上画1个命令按钮,并编写如下事件过程:
Private Sub Command1 Click( )
Dim a(3,3)
For m=1 To 3
For n=1 To 3
If n=m or n=4—m Then
a(m.n)=m+n
Else
a(m,n)=0
End If
Print a(m,n);
Next n
Print
Next m
End Sub
运行程序,单击命令按钮,窗体上显示的内容为( )。
A. 2 0 0
B. 2 0 4
C. 2 3 0
D. 2 0 0
[单项选择]在窗体中添加一个名称为Command1的命令按钮,然后编写如下事件代码:
Private Sub Command1_Click( )
Dim a(10,10)
For m=2 To 4
For n=4 To 5
a(m,n)=m*n
Next n
Next m
MsgBox a(2,4)+a(3,5)+a(4,5)
End Sub
运行窗体后,单击命令按钮,MsgBox中应输出( )。
A. 23
B. 33
C. 43
D. 53