Questions tagged [openfiledialog]

The OpenFileDialog is a (component) class in the .NET Framework that prompts the user to open one or multiple files.

The OpenFileDialog component allows users to browse the folders of their computer or any computer on the network and select one or more files to open. The dialog returns full path names of the files selected by user.

1068 questions
16
votes
8 answers

How to save last folder in openFileDialog?

How do I make my application store the last path opened in openFileDialog and after new opening restore it? OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; if…
Kenji
  • 163
  • 1
  • 1
  • 5
15
votes
5 answers

Why does OpenFileDialog change my working directory?

Why does OpenFileDialog change my working directory? Should i assume many func in System.Windows.Forms will change my working directory? OpenFileDialog open = new OpenFileDialog(); open.Filter = filter; a =…
user34537
15
votes
3 answers

Limiting the files that can be selected using Open File Dialog box

I have a C# Windows Forms application where I load either a XML file or a CSV file for some task operations. When I click the Browse button I have, an Open File Dialog box appears and I can navigate to a location on my drive and choose the file and…
user1501034
  • 343
  • 3
  • 6
  • 16
14
votes
1 answer

Required Dialog for selecting Multiple Files and Folders .NET

I thought it would be easy to find, I was wrong. Dialog Requirements: Can browse MULTIPLE FILES/FOLDERS in the same time. Can be used in .NET windows forms. FREE or can be used under GPL. Works in Win Xp and Win 7. Dialog Preferences: C# Looks…
watbywbarif
  • 6,487
  • 8
  • 50
  • 64
14
votes
3 answers

Open File Dialog Box

I'm learning Objective-C and trying to develop a simple zipper application, but I stopped when now, when I need to insert a button at my dialog and this button opens a Open File Dialog that will select a file to compress, but I never used a Open…
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
14
votes
2 answers

How do I customize the FileOpen dialog for >= Vista?

I'm looking to customize the Vista-like OpenFileDialog with custom WinForms and WPF controls. I know you can template the XP-like OpenFileDialog but that looks pretty ugly and doesn't satisfy my requirements. I know you can customize the…
Brian Mullen
  • 151
  • 7
14
votes
3 answers

C# - How to customize OpenFileDialog to select multiple folders and files?

I have posted - How to use OpenFileDialog to select a folder?, I couldn't find the correct answer. So, I have changed my question. I want to customize OpenFileDialog to select multiple folders and files. I tried to find a solution and could see some…
Yun
  • 5,233
  • 4
  • 21
  • 38
13
votes
2 answers

Open a workbook using FileDialog and manipulate it in Excel VBA

I am learning how to use Excel macros and I found this code: Dim fd As Office.FileDialog Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = False .Title = "Please select the file to kill his non colored…
user3576866
  • 417
  • 1
  • 4
  • 8
12
votes
6 answers

How do I set the Initial Directory on an OpenFileDIalog to the users `Downloads` folder in C#

Ok so I have an OpenFileDialog and I want to set the initial directory to the users 'Download' folder. This is an internal application and, therefore, I am sure that the user will be using Windows 7. var ofd = new OpenFileDialog(); //This doesn't…
JMK
  • 27,273
  • 52
  • 163
  • 280
12
votes
2 answers

Customizing OpenFileDialog

I am working on winforms application in C#. What I want to achieve is to get a file from user for which I am using the following code: OpenFileDialog dlg = new OpenFileDialog(); if (dlg.ShowDialog() == DialogResult.OK) { string sFileName =…
Jame
  • 21,150
  • 37
  • 80
  • 107
12
votes
4 answers

Default name with OpenFileDialog C#?

I set the default file name is answer_XXXXXX.csv in OpenFileDialog. But it displays like this. The default name "answer_XXXXXX.csv" isn't displayed full. Then I click on File name combo box. It displays exactly. How can I fix it?
Huy Duong Tu
  • 7,798
  • 5
  • 25
  • 46
12
votes
5 answers

Application says network drive doesn't exist, but found using OpenFileDialog

I have made a little app that's running on a Win7-PC. All it does, is to check the content of a network drive at 1:00 O'clock in the morning (and compare it to a folder on its local hard drive), and if there´s differences, copy the differences to…
Mads Aggerholm
  • 432
  • 1
  • 5
  • 13
11
votes
3 answers

Any way to circumvent "Dialogs must be user-initiated" exception?

My app has a 'open file' button. Before launching the OpenFileDialog, it asks whether the user wants to save the current file, and if they do, it launches a SaveFileDialog. It then launches the OpenFileDialog. Pretty standard stuff. My problem is…
user495625
  • 301
  • 2
  • 11
10
votes
2 answers

Is it possible to replace the system open file dialog?

I want to replace the standard system open file dialog with the one I wrote, that means no matter within which programs you are opening a file, my dialog will be shown instead of the standard one, is this possible? It seems that that there is no…
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
10
votes
4 answers

OpenFileDialog on .NET Core

On .NET Framework you can use System.Windows.Forms.OpenFileDialog for open files with the native Windows UI but that only works on Windows. There is a System.Windows.Forms.OpenFileDialog implementation for .Net Core or another alternative?
Vinicius Gualberto
  • 599
  • 1
  • 6
  • 15
1 2
3
71 72