设有以下窗体单击事件过程:Private Sub Form_Click()a=1For i=1 To 3Select Case i Case 1,3
设有以下窗体单击事件过程:
Private Sub Form_Click()
a=1
For i=1 To 3
Select Case i
Case 1,3
a=a+1
Case 2,4
a=a+2
End Select
Next i
MsgBox a
End Sub
打开窗体运行后,单击窗体消息框的输出内容应为【 】。
设有以下窗体单击事件过程:
Private Sub Form_Click()
a=1
For i=1 To 3
Select Case i
Case 1,3
a=a+1
Case 2,4
a=a+2
End Select
Next i
MsgBox a
End Sub
打开窗体运行后,单击窗体消息框的输出内容应为【 】。
设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:
Private Sub Command1_Click()
Static x as integer
X=f(x+5)
Cls
Print x
End Sub
Private function f(x as integer)as integer
F=x+x
End function
连续单击命令按钮3次,第3次单击命令按钮后,窗体上显示的计算结果是
A)10
B)30
C)60
D)70
若有以下窗体单击事件过程:Private SubForm_Click()
result=1
For i=1To 6 Step 3
result=result*i
Next i
MsgBoxresult
End Sub打开窗体运行后,单击窗体,则消息框的输出内容是()。
A.1
B.4
C.15
D.120
设有如下通用过程: 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
设有如下通用过程: 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
设有如下通用过程: Public Sub Fun(a()As Integer,x As Integer) For i=1 To 5 x=x+a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Commandl的命令按钮。然后编写如下的事件过程: Private Sub Commandl_Click() Dim arr(5)As Integer,n As Integer For i=1 To 5 arr(i)=i+i Next Fun arr,n Text1.Text=Str(n) End Sub 程序运行后,单击命令按钮,则在文本框中显示的内容是______。
A. 30
B.25
C.20
D.15
设有如下通用过程:Public Function Fun (xStr As String) As String Dim tStr As String,strL As Integer tStr=-" " strL=Len(xStr) i=strL/2 Do Whilei<=strL tStr=tStr &id(xStr,i+1,1) i=i+1 Loop Fun=tStr & tStrEnd Function 在窗体上画—个名称为Text1的文本框和—个名称为Command1的命令按钮,然后编写如下的事件过程:Private Sub Command1_ Click() Dim S1 String S1="ABCDEF" Text1.Text=LCase(Fun(S1))End Sub 程序运行后,单击命令按钮,文本框中显示的是 ______。
A.ABCDEF
B.abcdef
C.defdef
D.defabc
设有下列通用过程:
Public Function Fun(xStr As String)As String
Dim tStr As String,strL As Integer
tStr=""
strL=Len(xStr)
i=strL/2
DO While i<=StrL
tStr=tStr&Mid(xStr,i+1,1)
i=i+1
Loop
Fun=tStr&tStr
End Function
在窗体上画一个名称为Textl的文本框和一个名称为Command1的命令按钮。然后编写下列的事件过程:
Private Sub Commandl Click()
Dim S1 As String
S1="ABCDEF"
Text1.Text=LCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,文本框中显示的是()。
A.ABCDEF
B.abedef
C.defdef
D.defabc
设窗体上有一个名为Txtl的文本框和一个名为Commandl的命令按钮,并有以下事件过程:
Private Sub Commandl一Click()
x!==Val(Textl.Text)
Select Case x
Casc Is<-10,Is>=20
Print“输入错误”
Case Is<0
Print 20 x
Case ls<10
Print 20
Case Is=20
Print x+10
End Select
End Sub
程序运行时,如果存文本框中输入一5,则单击命令按钮后的输出结果是
A.5
B.20
C.25
D.输入错误