更多"在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一"的相关试题:
[单项选择]在窗体上画一个名称为CommonDialog1的通用对话框,一个名称为Command1的命令按钮。然后编写如下事件过程: Private Sub Command1_Click( ) CommonDialogl.FileName=“” CommonDialogl,Filter=“All File|*.*|(*.Doc)|*.Doc|(*.Txt)|*.Txt” CommonDialogl.Filterlndex=2 CommonDialogl.DialogTitle=“VBTest” CommonDialogl.Action=1 End Sub对于这个程序,以下叙述中错误的是
A. 该对话框被设置为“打开”对话框
B. 在该对话框中指定的默认文件名为空
C. 该对话框的标题为VBTest
D. 在该对话框中指定的默认文件类型为文本文件(*.Tx
[单项选择]在窗体上画一个名称为CommonDialog1的通用对话框,一个名称为Command1的命令按钮,要求单击命令按钮时,打开一个保存文件的对话框,该窗口的标题为“Save”,缺省文件名称为“SaveFile”,在“文件类型”栏中显示*txt,则能够满足上述要求的程序是
A) Private Sub Command1_Click ( ) CommonDialog1.FileName="SaveFile" CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC) |*.doc" CommonDialog1.FilterIndex=2 CommonDialog1.DialogTitle="Save" CommonDialog1.Action=2 End SubB) Private Sub Command1_Click ( ) CommonDialog1.FileName="SaveFile" CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC) |*.doc" CommonDialog1.FilterIndex=1 CommonDialog1.DialogTitle="Save" CommonDialog1.Action=2 End SubC) Private Sub Command1 Click ( ) CommonDialog1.FileName="Save" CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC) |*.doc" CommonDialog1.FilterIndex=2 CommonDialog1.DialogTitle="SaveFile" CommonDialog1.Action=2 End SubD) Private Sub Command1 Click ( ) CommonDialog1.FileName="SaveFile" CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC) |*.doc" CommonDialogl.FilterIndex=1 CommonDi
[填空题]在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一个名称为Command1的命令按钮,并编写如下事件过程:
Private Sub Command1_ Click( )
CommonDialog1. Flags = cd10FNHideReadOnly
CommonDialog1. Filter= "All Files (*.*) |*.* |Text Files" &
"(*.txt |*.txt|Batch Files (*.bat)|*.bat)"
CommonDialog1. FilterIndex = 1
CommonDialog1.ShowOpen
MsgBox CommonDialog1.FileName
End Sub
程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是 ______ ;如果在对话框中选择D盘temp 目录下的te1.txt 文件,然后单击“确定”按钮,则在信息框中显示的提示信息是______ 。
[单项选择]在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一个名为Command1的命令按钮,并编写如下事件过程: Private Sub Command1_ Click( ) CommonDialog1. Flags= cd10FNHideReadOnly CommonDialog1. Filter= "All Files (*.*) |*.*|Text File" & _ "(*.txt) |*.txt | Batch Files (*.bat)| *.bat" CommonDialog1. FilterIndex = 2 CommonDialog1. ShowOpen MsgBox CommonDialog1. FileName End Sub程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是______ 。
A. All Files (*.*)
B. Text Files(*.tx
C. Batch Files (*.ba
D. 不确定
[单项选择]在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一个命令按钮,并编 写如下事件过程: Private Sub Command1_Click( ) CommonDialog1.Flags=cdlOFNHideReadOnly CommonDialog1.Filter="All Files(*.*)|*.*|Text Files"&_ "(*.txt)|*.txt|Batch Files(*.bat)|*.bat" CommonDialog1.FilterIndex=2 CommonDialog1.ShowOPen MsgBox CommonDialog1.filename End Sub 程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是______。
A. All Files(*.*)
B. Text Files(*.tx
C. Batch Files(*.ba
D. 不确定
[单项选择]在窗体上画一个通用对话框,其名称为CommonDialog1,然后画一个命令按钮,并编写如下事件过程:
Private Sub Command1_Click( )
CommonDialog1.Flags=vbOFNHideReadOnly
CommonDialog1.Filter="All Files(*.*)|*.*|Text Files(*.txt)|*.txt
CommonDialog1.Filterlndex=1
CommonDialog1.ShowOpen
MsgBox CommonDialog1.FileName
End Sub
程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是
A. All Files(*.*)
B. Text Files(*.txt)
C. *.txt
D. All Files(*.*)