.NET

Reply
Active Contributor
Posts: 34
Registered: ‎08-22-2005
Message 1 of 5 (458 Views)

How to set multiple file extension of the OpenFileDialg?

458 Views, 4 Replies
03-09-2007 08:52 PM
I can set the single file extension for Autodesk.AutoCAD.Windows.OpenFileDialg like this:
Autodesk.AutoCAD.Windows.OpenFileDialg dlg = new Autodesk.AutoCAD.Windows.OpenFileDialog("select files", null, "dwg", null, Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags.AllowMultiple);
But how to set set multiple file extension?
I have tried "dwg|dxf",but it does not work.
Active Contributor
Posts: 43
Registered: ‎11-07-2006
Message 2 of 5 (458 Views)

Re: How to set multiple file extension of the OpenFileDialg?

03-09-2007 11:13 PM in reply to: csharpbird
Hello,
Give it a try......

OpenFileDialog Ofn = new OpenFileDialog();
Ofn.Filter = "C Sharp Files (*.cs)|*.cs|Text Files (*.txt)|*.txt";
Ofn.Title = "Type File";
Ofn.Multiselect = true;
Ofn.ShowDialog();

Best Regards,
Basha
*Kerry Brown
Message 3 of 5 (458 Views)

Re: How to set multiple file extension of the OpenFileDialg?

03-10-2007 12:28 AM in reply to: csharpbird
For Multiple file extension options as you indicate, you could use :-
// using SWF = System.Windows.Forms;
// --
SWF.OpenFileDialog dlg = new SWF.OpenFileDialog();

dlg.Filter = "Drawing Based Files (*.dwg, *.dxf)|*.dwg;*.dxf";

dlg.Multiselect = true;

//kwb

wrote in message news:5514377@discussion.autodesk.com...
I can set the single file extension for
Autodesk.AutoCAD.Windows.OpenFileDialg like this:
Autodesk.AutoCAD.Windows.OpenFileDialg dlg = new
Autodesk.AutoCAD.Windows.OpenFileDialog("select files", null, "dwg", null,
Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags.AllowMultiple);
But how to set set multiple file extension?
I have tried "dwg|dxf",but it does not work.
Contributor
Posts: 12
Registered: ‎11-22-2006
Message 4 of 5 (458 Views)

Re: How to set multiple file extension of the OpenFileDialg?

03-10-2007 04:56 PM in reply to: csharpbird
If you're using OpenFileDialog from Autocad, separate the extensions with semicolons eg. "dwg;dwt"
Contributor
hoangvuminh
Posts: 11
Registered: ‎04-28-2011
Message 5 of 5 (321 Views)

Re: How to set multiple file extension of the OpenFileDialg?

05-23-2011 08:12 AM in reply to: GlennR

For example

 

Dim dlg As Autodesk.AutoCAD.Windows.OpenFileDialog = New Autodesk.AutoCAD.Windows.OpenFileDialog("Open Dat Files", "", "dat", "", 0)

 

Works like a Champ

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community