题目内容:
在窗体上画一个名称为CommonDialog1的通用对话框,一个名称为Command1的命令按钮,要求单击命令按钮时,打开一个保存文件的对话框,该窗口的标题为"Save",缺省文件名称为"SaveFile",在"文件类型"栏中显示*txt,则能够满足上述要求的程序是( )。A.PrivateSubCommand1_Click()
CommonDialog1.FileName="SaveFile"
CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC.|*.doc"
CommonDialog1.FilterIndex=2
CommonDialog1.DialogTitle="Save"
CommonDialog1.Action=2
EndSub
B.PrivateSubCommand1_Click()
CommonDialog1.FileName="SaveFile"
CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC.|*.doc"
CommonDialog1.FilterIndex=1
CommonDialog1.DialogTitle="Save"
CommonDialog1.Action=2
EndSub
C.PrivateSubCommand1_Click()
CommonDialog1.FileName="Save"
CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC.|*.doc"
CommonDialog1.FilterIndex=2
CommonDialog1.DialogTitle="SaveFile"
CommonDialog1.Action=2
EndSub
D.PrivateSubCommand1_Click()
CommonDialog1.FileName="SaveFile"
CommonDialog1.Filter="AllFiles|*.*|(*.txt)|*.txt|(*.doC.|*.doc"
CommonDialog1.FilterIndex=1
CommonDialog1.DialogTitle="Save"
CommonDialog1.Action=1
EndSub
参考答案:
答案解析: