在窗体上画1个命令按钮,并编写如下事件过程:Private Sub Command1-Click()For i=5 To 1 Step-0.8
在窗体上画1个命令按钮,并编写如下事件过程:
Private Sub Command1-Click()
For i=5 To 1 Step-0.8
Print Int(i);
Next i
End Sub
运行程序,单击命令按钮,窗体上显示的内容为
A.5 4 3 2 1 1
B.5 4 3 2 1
C.4 3 2 1 1
D.4 4 3 2 1 l
在窗体上画1个命令按钮,并编写如下事件过程:
Private Sub Command1-Click()
For i=5 To 1 Step-0.8
Print Int(i);
Next i
End Sub
运行程序,单击命令按钮,窗体上显示的内容为
A.5 4 3 2 1 1
B.5 4 3 2 1
C.4 3 2 1 1
D.4 4 3 2 1 l
在窗体上画1个命令按钮,并编写如下事件过程i
Private Sub Commandl—Click()
Dim a(3,3)
For m=1 T0 3
F0r 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
Prim
Next m
End Sub
运行程序,单击命令按钮,窗体上显示的内容为
A.2 0 0
B.2 0 4
C.2 3 0
D.2 0 0
在窗体上画1个命令按钮,其名称为Command1,然后编写如下事件过程:
Private Sub Command1_Click()
Dim arr(1 To 100)As Integer
For i=1 To 100
arr(i)=Int(Rnd*1000)
Next i
Max=arr(1)
Min=arr(1)
For i=1 To 100
If________Then
Max=arr(i)
End If
If________Then
Min=arr(i)
End If
Next i
Print"Max=";Max,"Min=";Min
End Sub
程序运行后,单击命令按钮,将产生100个1000以内的随机整数,放入数组arr中,然后查找并输出这100个数中的最大值Max和最小值Min,请填空。
在窗体上画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 0 4 0 0 0 6
B.2 0 4 0 4 0 4 0 6
C.2 3 0 3 4 0 0 0 6
D.2 0 0 0 4 5 0 5 6
A.5 4 3 2 1 1
B.5 4 3 2 1
C.4 3 2 1 1
D.4 4 3 2 1 1
在窗体上画1个名称为Command1的命令按钮,然后编写如下事件过程: 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 Print a EndSub 程序运行后,单击命令按钮,输出结果是______。
A.0
B.2
C.3
D.4
在窗体上画1个命令按钮,其名称为Command1,然后编写如下事件过程:
PriVate Sub Commandl_CUck()
Dimalt(1 To 100)As Integer
Fori=1 To 100
arr(i)=Int(Rnd*1000)
Nexti
Max=arr(1)
Min=arr(1)
Fori=1 To 100
If [12] Then
Max=arr(i)
Private Sub Command1_Click()
CommonDialog1.______="打开文件"
CommonDialog1.Filter="All Files(*.*)|*.*"
CommonDialog1.InitDir="c:\"
CommonDialog1.ShowOpen
End Sub
该程序的功能是,程序运行后,单击命令按钮,将显示“打开”文件对话框,其标题是“打开文件”,在“文件类型”栏内显示“AIl Files(*.*)”,并显示C盘根目录下的所有文件,请填空。
在窗体上画1个名称为Command1的命令按钮,然后编写如下事件过程
Option Base 1
Pribate Sub Command1_Click()
Dim a(5.5) As Integer
For i=1 To 5
a(I,j)*5\10
Next j
Next i
S=0
For i=1 To 5
S=s+a(i,i)
Next i
Print s
End Sub
程序运行后,单击命令按钮,输出结果是()。
A.15
B.13
C.11
D.9
3在窗体上画1个命令按钮(名称为Commandl)和1个文本框(名称为Text1),然后编写如下事件过程: Private Sub Commandl_Click() x=Val(Text1.Text) SelectCaseX Case 1,3 y=X*X CaseIS>=10,IS<=-10 y=X Case-10 To 10 y=-X End Select End S
A.执行y=x*x
B.执行y=-x
C.先执行y=x*x,再执行y=-x
D.程序出错
在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一个命令按钮,并编写如下事件过程:
Private Sub Command1_Click()
CommonDialog1.Flags=vbOFNHideReadOnly
CommonDialog1.Filter="All Files(*.*)|*.*|Text Files(*.txt)|*.txt
CommonDialog1.FiherIndex=1
CommonDialog1.ShowOpen
MsgBox CommonDialog1.FileName
End Sub
程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是
A.All Files(*.*)
B.Text Files(*.*)
C.*.txt
D.All Files(*.*)|Text Files(*.*)
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!