题目内容

在窗体上画一个名称为“Command1”,标题为“计算”的命令按钮,再画7个标签,其中5个标签组成.名称为Labell的控件数组;名称为Label2的标签用于显示计算结果,其Caption属性的初始值为空:标签Label3的标题为“计算结果”。运行程序时会自动生成5个随机数,分别显示在标签控件数组的各个标签中。单击“计算”按钮,则将标签数组各元素的值累加,然后计算结果显示在Label2。下列为“计算”按钮的事件过程,请为下划线处选择合适的语句()。
Private Sub Commandl_Click() Sum=0 For i=0 To 4 Sum=Sum+______ Next ______ =Sum End Sub

A. Labell(i).Caption Label2.Caption
B. Labell(i).Caption Label3.Caption
C. Labell.Caption Label2.Caption
D. Labell.Caption Label3.Caption

查看答案
更多问题

下列程序运行时输出的结果是()。 Option Base 1 Const a=10 Private Sub Form_Click() Dim x(A)As Integer k=-1 For i=1 To a x(i)=i*k k=(-1)*k Next i For i=1 To 10 Print x(i) Next i End Sub

A. 1 3 5 7 9 10
B. -1-3-5-7-9
C. -1 2-3 4-5 6-7 8-9 10
D. 1-2 3-4 5-6 7-8 9-10

在窗体上画一个名称为Text1的文本框,然后画3个单选按钮,并用这3个单选按钮建立一个控件数组,名称为Option1,程序运行后,如果单击某个单选按钮,则文本框中的字体将根据所选择的单选按钮切换,请选择空白处合适的语句()。 Private Sub Optionl_Click(Index As Integer) Select Case Case 0 a="宋体" Case 1 a="黑体" Case 2 a="楷体 GB2312" End Select Text =a End Sub

A. Option Text
B. Index Text
C. Index Font
D. Option Font

有如下函数过程: Function funl(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是()。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,B)Print x End Sub

A. 0
B. 25
C. 50
D. 100

下列()事件过程可以将打开文件对话框的标题改变为“new Caption”。

A. Prirate Sub Commandl Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowFont End Sub
B. Private Sub Commandl+Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowOpen End Sub
C. Private Sub Commandl_Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowHelp End Sub
D. Private Sub Commandl_Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowColor End Sub

答案查题题库