假定有如下的命令按扭(名称为Command1)事件过程: Private Sub Command1_Click() x=InputBox(“输入:”,“输入整数”) MsgBox“输入的数据是:”,,“输入数据:”+x End Sub 程序运行后,单击命名按扭,所果从键盘上输入整数10,则以下叙述中错误的是______。
A.x的值是数值10
B.输入对话框的标题是“输入整数”
C.信息框的标题是“输入数据:10”
D.信息框中显示的“输入的数据是:”
第1题:
窗体上有一个命令按钮Command1,编写如下事件过程:
Private Sub Command1_Click()
x = InputBox("x=")
y = InputBox("y=")
Print x + y
End Sub
运行后,单击命令按钮,先后在两个输入对话框中输入123和321,窗体显示的内容是( )。
A、 444
B、 123321
C、 123+321
D、 出错信息
第2题:
设在工程中有一个标准模块,其中定义了如下记录类型:Type Books Name As String *10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_ Click时,在顺序文件 Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。
A.Private Sub Command1_ Click() Dim x As Books Open "C:\Person. txt" for Output As #1 x. Name=InputBox(“输入姓名”) x. TelNum=InPutBox(“输入电话号码”) Write #1,x.Name,x.TelNum Close #1 End Sub
B.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Input As #1 x.Name=InputBox(“输入姓名”) x. TelNum=InputBox(“输入电话号码”) Print #1,x. Name,x. TelNum Close #1End Sub
C.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Output As #1 x. Name=InputBox(“输入姓名”) x. TelNum= InputBox(“输入电话号码”) Write #1,x Close #1End Sub
D.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Input As #1 x. Name= InputBox(“输入姓名”) x.TelNum=InputBox(“输入电话号码”) Print #1,Name,TeINum Close #1End Sub
第3题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() x=0 n=InputBox("") For i=1 To n For j=1 To i x=x+1 Next j Next i Print x End Sub 程序运行后,单击命令按钮,如果输入3,则在窗体上显示的内容是______。
A.3
B.4
C.5
D.6
第4题:
在窗体上画一外名称Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
x=0
n=InputBox(" ")
For i = 1 To n
For j = 1 To i
x=x+1
Next j
Next i
Print x
End Sub
程序运行后,单击命令按钮,如果输入3,则在窗体上显示的内容是【 】。
第5题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1 Click () x=0 n=InputBox ("") For i=1 TO n For j=1 To i x=x+1 Next j Next i Print x End Sub 程序运行后,单击命令按钮,如果输入3,则在窗体上显示的内容是( )。
A.3
B.4
C.5
D.6