如何判定common dialog的"打开“或者”保存“按钮被按下了 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先设置CommonDialog1.CancelError=True Private Sub Command1_Click() On Error GoTo es Me.CommonDialog1.ShowColor MsgBox "选取了确定" Exit Subes: MsgBox Err.DescriptionEnd Sub 一般都是判断取消是不是按下的pcwak说得没错 是啊,是有问题!楼主的问题是如何判断Common dialog控件提供的操作对话框执行后是点的确认还是取消? 通過看commom dialog返回值的檢查,選取消一般返回空 Private Sub Command1_Click()' 设置“CancelError”为 TrueCommonDialog1.CancelError = TrueOn Error GoTo ErrHandler' 设置标志CommonDialog1.Flags = cdlOFNHideReadOnly' 设置过滤器CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files" & _"(*.txt)|*.txt|Batch Files (*.bat)|*.bat"' 指定缺省的过滤器CommonDialog1.FilterIndex = 2' 显示“打开”对话框CommonDialog1.ShowOpen' 显示选定文件的名字MsgBox CommonDialog1.filenameExit SubErrHandler:' 用户按了“取消”按钮Exit SubEnd Sub 高手帮个忙 VB中datareport如何打印备注内容 VB打开excel文件,出现只读,不知何故?? 新手提问 请帮忙推荐一两本适合深入学习VB 的书 Access真不是个东西,哪有这么大的啊,郁闷中,散分 请教一个问题,谢谢 请问在VSflexgrid7.0中完成从选中的多条记录并删除?我是菜鸟,给点代码提示吧 在那里可以找到用VB开发的代理服务器软件的源代码 带密码的SELECT语句 实时错误13,类型不匹配! 哪位仁兄可以提供有关手术室的vb原代码或程序的下载。? 请问如何实现如下的打印形式
On Error GoTo es
Me.CommonDialog1.ShowColor
MsgBox "选取了确定"
Exit Sub
es:
MsgBox Err.Description
End Sub
pcwak说得没错
楼主的问题是如何判断Common dialog控件提供的操作对话框执行后是点的确认还是取消?
' 设置“CancelError”为 True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' 设置标志
CommonDialog1.Flags = cdlOFNHideReadOnly
' 设置过滤器
CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files" & _
"(*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' 指定缺省的过滤器
CommonDialog1.FilterIndex = 2
' 显示“打开”对话框
CommonDialog1.ShowOpen
' 显示选定文件的名字
MsgBox CommonDialog1.filename
Exit SubErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub