.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set multiple file extension of the OpenFileDialg?

4 REPLIES 4
Reply
Message 1 of 5
csharpbird
996 Views, 4 Replies

How to set multiple file extension of the OpenFileDialg?

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.
4 REPLIES 4
Message 2 of 5
Anonymous
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
Message 3 of 5
Anonymous
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.
Message 4 of 5
GlennR
in reply to: csharpbird

If you're using OpenFileDialog from Autocad, separate the extensions with semicolons eg. "dwg;dwt"
Message 5 of 5
hoangvuminh
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost