更多"在窗体上画一个命令按钮,名称为Command1。程序运行后,如果单击命"的相关试题:
[单项选择]在窗体上画一个命令按钮,名称为Command1。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程F1。在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则返回0。能够正确实现上述功能的代码是
A. Private Sub Command1_Click( ) x=Input Box("请输入整数") a=F1(Val() Print a End Sub Function Fl(ByRef b As Intege If b Mod2=0 Then Return0 Else Return 1 End lf End Function
B. Private Sub Command1_Click( ) x=Input Box(“请输入整数”) a=Fl(Val() Print a End Sub Function Fl(ByRef b As Intege lf b Mod 2=0 Then Fl=0 Else Fl=1 End lf End Function
C. Private Sub Command1 Click() x= Input Box(“请输入整数”) F1(Val() Print a Enb Sub Function Fl(ByRef b As Intege If b Mod2=0 Then Fl=1 Else Fl=0 End lf End Function
D. Private Sub Command1_Click( ) x=Input Box(“请输入整数”) F1(Val() Print a End Sub Function Fl(ByRef b As Intege lf b Mod2=0 Then Return 0 Else Return1 End lf End Function
[单项选择]在窗体上画一个名称为CommonDialog1的通用对话框,一个名称为Command1的命令按钮,要求单击命令按钮时,打开一个保存文件的对话框,该窗口的标题为“Save”,缺省文件名称为“SaveFile”,在“文件类型”栏中显示*txt,则能够满足上述要求的程序是( )。
A. java
B. javac
C. javap
D. javadoc
[单项选择]在窗体上画一个名称为、commonDidog1的通用对话框,一个名称为Command1的命令按钮。要求单击命令按钮时,打开一个保存文稿件的通用对话框。该窗口的标题为”Save",缺省文件名为”SaveFile",在“文件类型”栏中显示*.txt,则能够满足上述要求的程序是
A. Private Sub Command1_Click( ) CommonDislog1.FileName="SaveFile" CommonDialog1.Filter="All Files
B. Pnrate Sub Command1_Click( ) CommonDialog1.FileNamc="SaveFile" CommonDialog1.Filtcr="All Files
C. Private Sub Command1_C1ick( ) CommonDialog1.FileName="Saven" CommonDislog1.Filter="All Files
D. PnvateSubCommarldl_C1ick( ) CommonDialog1.FUeName="SaveFile" CommonDialog1.Filter="All Files
[单项选择]在窗体上画一个名称为CommonDialog1的通用对话框和一个名为Command1的命令按钮。要求实现这样一个功能:单击命令按钮后,打开一个通用对话框用于保存文件,其窗口标题为“保存”,默认文件名为Data,在“文件类型”栏中显示*.txt。下列程序中能实现以上功能的是______ 。
A. Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.|* |(*.tx|(*.do|*.doc" CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub
B. Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.tx|(*.do|*.doc" CommonDialog1. FilterIndex = 2 CommonDialog1. DialogTitle =“保存” CommonDialog1. Action = 1 End Sub
C. Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.tx|(*.do|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 1 End Sub
D. Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.tx|(*.do|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub
[单项选择]在窗体上画一个名为CommonDialog1的通用对话框,一个名称为Command1的命令按钮。要求单击命令按钮时,打开一个保存文件的通用对话框窗口。该窗口的标题为“Save”,默认文件名为“SaveFile",在“文件类型”栏中显示“*.txt”。能够满足上述要求的程序是 ______ 。
A. Private Sub Command1_ Click() CommonDialog1. FileName = "SaveFile" CommonDialog1. Filter = "All Files | *.* |*.txt *.txt| *.doc| *.doc" CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = "Save" CommonDialog1. Action = 2 End Sub
B. Private Sub Command1_Click() CommonDialog1. FileName = "SaveFile" CommonDialog1. Filter = "All Files |*.* | *.txt|*.txt|*.doc|*.doc" CommonDialog1. Filterlndex = 1 CommonDialog1. DialogTitle = "Save" CommonDialog1. Action = 2 End Sub
C. Private Sub Command1_ Click() CommonDialog1. FileName = "Save" CommonDialog1. Filter = "All Files |%* |*.txt|*.txt|*.doc|*.doc" CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = "Save" CommonDialog1. Action = 2 End Sub
D. Private Sub Command1_ Click() CommonDialog1. FileName = "SaveFile" CommonDialog1. Filter = "All Files |*.*|*.txt|*.txt|*.doc|*.doc" CommonDialog1. Filterlndex = 1 CommonDialog1. DialogTitle = "Save". CommonDialog1. Action = 1 End Sub
[单项选择]在窗体上画一个命令按钮,其名称为Command1。程序运行后,单击命令按钮,输出结果为 ( )。 Private Sub p1(n As Integer) For i=n To 1 Step-1 x=String(i, "*") Print x Next i End Sub Private Sub Command1_Click( ) p1 (3) End Sub
A. * * * * * *
B. * * * * * *
C. * * *
D. * * * * * *
[单项选择]在窗体上画一个命令按钮,其名称为Command1。程序运行后,单击命令按钮,输出结果是( )。
Private Sub p1(n As Integer)
For i=n To 1 Step-1
x=String(i,"*")
Print x
Next i
End Sub
Private Sub Command1_Click( )
p1(3)
End Sub
[单项选择]在窗体上画一个命令按钮,命名为CommandI。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程 F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则返回0。 能够正确实现上述功能的代码是
A. Privme Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val() Print a End Sub Function F1(ByRef b As Intege If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
B. Private Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val() Print a End Sub Function F1(ByRef b As Intege If b Mod 2=0 Then F1=0 Else F1=1 End If End Function
C. Private Sub Command1_Click() x=InputBox(“请输入整数”) F1(Val() Print a End Sub Function F1(ByRef b As Intege If b Mod 2=0 Then F1=1 Else F1=0 End If End Function
D. Private Sub Command1_Click() x=InputBox(“请输入整数”) F1 (Val() Print a End Sub Function F1(ByRef b As Intege If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
[单项选择]在窗体上画一个命令按钮,名称为Command1。 Private Sub Command1 Click( ) Dim x As Integer,y As Integer x=10:y:0 Do x=x+2:y=y+x Print "x=", x; "y=",y If y>20 Then Exit Do Loop Until x=18 End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是 ______。
A. x=12y=12 x = 14 y = 16 x=16 y=18
B. x=12 y=12 x= 16 y =28 x= 18 y=24
C. x=12 y=12 x= 14 y=44
D. x= 12 y=12 x= 14 y=26
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程: Private Sub Command1_Click( ) a$="software and hardware" b$=Right(a$,8) c$=Mid(a$,1,8) MsgBox aS,b$,c$,1 End Sub 则在弹出的信息框的标题栏中显示的信息是
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click( ) For I=1 To 4 For J=0 To 1 Print Chr$(65+1); Next J Print Next 1 End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是
A. BB CCC DDDD EEEEE
B. A BB CCC DDDD
C. B CC DDD EEEE
D. AA BBB CCCC DDDDD