执行下列程序后,鼠标单击窗体,输出结果为( )。
Private Sub Form_Click( )
Print "Click";
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift
A:As Integer,X As Single,Y As Single) B:Print "Down" C:End Sub D:Private Sub Form_MouseUp(Button As Integer, Shift_As Integer,X As Single,Y As Single) E:Print "Up" F:End Sub DownUpClick G:ClickDownUp H:DownClickUp I:UpDownClick
有如下一个函数过程:
Function Fun(a As Integer)
Static c
b=0:b=b+1:c=c+1
Fun=a+b+c
End Function
在窗体上添加一个命令按钮,事件过程如下:
Private Sub Command1_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Fun(
A:;
Next
End Sub
运行该程
有如下程序:
Function F(a As Integer)
b = 0
Static C
b = b + 1
c = c + 2
F = a + b + c
End Function
Private Sub Command1_Click( )
Dim a As Integer
a = 2
For i=1 To 3
Print F(
A:;
Next i
End Sub
 
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:
Private Sub sub1(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 sub1(1, 2,
A:
Print a
End Sub
程序运行后,单击命令按钮,则窗体上显示的内容是A) 8 B:2 C:5 D:11
End Sub
A:Pfivate Sub Commgld1_LClick() B:Private Sub Command1_Click() C:Pfivate Sub Command1_ C1ick() D:Private Sub Command1_C1ick()
在窗体中有一个命令按钮Commandl,对应的事件代码如下:
Private Sub Commandl_nter( )
Dim num As Integer
Dim a As Integer
Dim b As Integer
Dim i As Integer
For i=1 To 10
num=InputBox(“请输入数据:”,“输入”,1)
If Int(num/2) =num/2 Then
a=a+1
Else
b=b+1
End If
Next i
MsgBox(“运行结果:a="& Str(
A:&:",b="& Str( B:)
End Sub
运行以上事件所完成的功能是( )。A) 对输入的10
在窗体上画1个文本框,名称为Text1,然后编写如下程序:
Private Sub Form Load( )
Open "C:/dat.txt" For Output As#1
Text1.Text=""
End Sub
Private Sub Text1_KeyPress(KeyAscii As integer)
If______=13 Then
If UCase(Text1.Text=______)Then
Close 1
End
Else
Write#1,Text1.Text
"Text1.Text=""
End If
End If
End Sub
程序的功能是,存C盘根目录下建立1个名为dat.txt的文件,在文本框中输入字符,每次按回车键(回车符的ASCII码是13)都把当前文本框中的内容写入文件dat.txt中,并清空文本框中的内容;如果输入“END”,则结束程序,请选择适合空白处的语句( )。
A:KeyAscii "END" B:Text1.Text "END" C:Text1.Text 13 D:KeyAscii 13
End语句在不同的环境下其用途是不同的。下列两条语句:End Sub和End Select所对应的用途是______。
A:结束Sub过程,结束记录类型定义 B:结束函数过程,结束记录类型定义 C:结束Sub过程,结束情况语句 D:结束函数过程,结束情况语句