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
10
votes
3 answers

Loading Image to Filestream

I am loading an image using OpenFileDialog open = new OpenFileDialog(); After I select the file, "open" is populated with several items, including the path. Now I would like to load the file into a filestream (or something similar) to be sent via…
mouthpiec
  • 3,923
  • 18
  • 54
  • 73
10
votes
4 answers

Delphi 7 and Vista/Windows 7 common dialogs - events do not work

I'm trying to modify the Delphi 7 Dialogs.pas to access the newer Windows 7 Open/Save dialog boxes (see Creating Windows Vista Ready Applications with Delphi). I can display the dialogs using the suggested modifications; however, events such as…
JeffR
  • 313
  • 6
  • 13
10
votes
2 answers

Opening File (Tkinter)

I'm trying to make a Tkinter program that can open a file. So far it opens a tk window that has an option that says File then a drop-down menu and it says open when you click it it opens a file window but i cant figure out how to actually open that…
Serial
  • 7,925
  • 13
  • 52
  • 71
10
votes
4 answers

C# OpenFileDialog Lock To Directory

I am making a software that needs to ONLY be able allow people to select files and folders using the OpenFileDialog that are in the same directory as the program and that are in deeper folders. I don't want the OpenFileDialog to be able to select…
QAH
  • 4,200
  • 13
  • 44
  • 52
10
votes
3 answers

When does Microsoft.Win32.OpenFileDialog.ShowDialog() return null?

OpenFileDialog's ShowDialog method returns a nullable boolean, set to true if the user clicked OK or false if he clicked Cancel. When does it return null? The documentation does not say.
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
9
votes
16 answers

OpenFileDialog InitialDirectory doesn't work

I have this code: OpenFileDialog dialog = new OpenFileDialog(); dialog.InitialDirectory = GetDataPath(...); dialog.AutoUpgradeEnabled = false; dialog.Filter = GetFilter(...); if (dialog.ShowDialog(this) == DialogResult.OK) {...} I expect, at every…
Mircea Ispas
  • 20,260
  • 32
  • 123
  • 211
9
votes
7 answers

How can I prevent an exception when I cancel an openfiledialog?

My program has a button which when clicked opens an openfiledialog to choose a picture: private string ChoosePicture() { fDialog.Title = "Select Picture"; fDialog.Filter = "Image Files (*.bmp, *.gif, *.jpg)|*.bmp; *.gif*;*.jpg"; …
Fuzz Evans
  • 2,893
  • 11
  • 44
  • 63
9
votes
1 answer

WPF Open FIle Dialog theme

I'm using Microsoft.Win32.OpenFileDialog in my WPF application for selecting file: var dlg = new Microsoft.Win32.OpenFileDialog { Title = "Select configuration", DefaultExt = ".xml", Filter = "XML-file (.xml)|*.xml", CheckFileExists…
kyrylomyr
  • 12,192
  • 8
  • 52
  • 79
9
votes
4 answers

Can I launch DotNet's OpenFileDialog in C:\Users\Public\Documents?

Is there a way to launch the OpenFileDialog in the C:\Users\Public\Documents folder? I am writing a C# application, using the DotNet framework. I am trying to launch an OpenFileDialog, with an InitialDirectory of "C:\\Users\\Public\\Documents\\"…
Jasper
  • 409
  • 4
  • 17
9
votes
7 answers

C#, WPF - OpenFileDialog does not appear

I have been searching up and down the web and unfortunately never came across an issue quite like mine, so here goes: My C# WPF application won't show me no OpenFileDialogs or SafeFileDialogs. private void btnBrowseNet_Click(object sender,…
Koarl
  • 246
  • 1
  • 2
  • 10
9
votes
4 answers

Select both files and folders using OpenFileDialog

I have researched a lot to find a suitable answer to this problem, but I am failing . I can see multiple questions asked here and on other forums also , but no clear answer that brings a clear solution . I want OpenFileDialog to select file/files…
B Bhatnagar
  • 1,706
  • 4
  • 22
  • 35
9
votes
1 answer

Qt standard dialogs example: Open file

I'm beginning to learn Qt for use in one of my projects, and what I need to do is create a GUI that allows the user to open a file. I was looking through the examples and I found one of them that has exactly what I need; the problem is that it's…
JM92
  • 1,063
  • 3
  • 13
  • 22
9
votes
2 answers

How do I add a form to a console app so that user can select file?

I have created a console application and have it working the way I want it to. Using the "Add Item" > "Add Windows Form" option in VS2010, it has automatically created what I need. I have added a button and code to retrieve an Excel file (below) My…
Chris
  • 934
  • 1
  • 17
  • 38
9
votes
6 answers

How to specify path using open file dialog in vb.net?

In the first start of my application I need to specify a path to save some files to it. But in the open file dialogue it seems like that I have to select a file to open. How can I just specify a folder without oppening a file like C:\config\ Here is…
FPGA
  • 3,525
  • 10
  • 44
  • 73
8
votes
3 answers

Filtering the files shown in OpenFileDialog based on content?

Is there a way to modify the behavior of the OpenFileDialog so that it looks inside the files in the folder it opens to and then ignores certain ones based on their content? One example would be to open to a folder full of Zip files but only show…
djcouchycouch
  • 12,724
  • 13
  • 69
  • 108