您的位置首页生活百科

我安装的VB怎么没有通用对话框?哪里去了?部件里没!难道是精简版的缘故?

我安装的VB怎么没有通用对话框?哪里去了?部件里没!难道是精简版的缘故?

的有关信息介绍如下:

我安装的VB怎么没有通用对话框?哪里去了?部件里没!难道是精简版的缘故?

按照你说的部件里没,那就是精简版的缘故,解决办法:1.下载控件"comdlg32.ocx"2.用代码直接调用系统动态链接库,比如下面的代码Dim f, s: s = String(260, Chr(0)) Set f = CreateObject("MSComDlg.CommonDialog") With f .Flags = &H4 .MaxFileSize = 260 .InitDir = "g:\" .Filter = "所有文件(*.*)|*.*|文本文件(*.txt)|*.txt" .FilterIndex = 2 '.DefaultExt = .Filter .ShowSave s = .FileName End With If s <> "" Then Label1.Caption = s Set f = Nothing