在窗体上画一个名称为CommonDialog1的通用对话框和一个名为Command1的命令按钮。要求实现这样一个功能:单击命令按钮后,打开一个通用对话框用于保存文件,其窗口标题为“保存”,默认文件名为Data,在“文件类型”栏中显示*.txt。下列程序中能实现以上功能的是______。A.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.|* |(*.txt)|(*.doc)|*.doc" CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End SubB.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doc)|*.doc" CommonDialog1. FilterIndex = 2 CommonDialog1. DialogTitle =“保存” CommonDialog1. Action = 1 End SubC.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doe)|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 1 End SubD.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doc)|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub
在窗体上画一个名称为CommonDialog1的通用对话框和一个名为Command1的命令按钮。要求实现这样一个功能:单击命令按钮后,打开一个通用对话框用于保存文件,其窗口标题为“保存”,默认文件名为Data,在“文件类型”栏中显示*.txt。下列程序中能实现以上功能的是______。
A.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.|* |(*.txt)|(*.doc)|*.doc" CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub
B.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doc)|*.doc" CommonDialog1. FilterIndex = 2 CommonDialog1. DialogTitle =“保存” CommonDialog1. Action = 1 End Sub
C.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doe)|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 1 End Sub
D.Private Sub Command1_ Click() CommonDialog1. FileName = "Data" CommonDialog1. Filter = "All Files|*.*|(*.txt)|(*.doc)|*.doc" CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub