openfiledialog

How do you configure an OpenFileDIalog to select folders?

In VS .NET, when you are selecting a folder for a project, a dialog that looks like an OpenFileDialog or SaveFileDialog is displayed, but is set up to accept only folders. Ever since I've seen this I've wanted to know how it's done. I am aware of the FolderBrowserDialog, but I've never really liked that dialog. It starts too small and...

Delphi: OpenFileDialog crashes with URL

Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult := OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5 ...

Changing/Adding controls to the windows Open/Save common dialog

Is there a way of changing/adding to the windows Open/Save common dialog to add extra functionality? At work we have an area on a server with hundreds of 'jobfolders'- just ordinary windows folders created/managed automatically by the database application to house information about a job (emails/scanned faxes/Word docs/Spreadsheets/Phot...

Open Dialog preserving settings

How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified. ...

Increase number of characters in filename field of GetOpenFileName file selection dialog

Our app allows multiple files to be selected in a file selection dialog which is shown via the GetOpenFileName function (this question also applies to folks using CFileDialog, etc...) There appears to be a limit to the number of characters that can be typed into the filename field (259 seems to be the magic number - not sure why). We h...

./ changes target when i use OpenFileDialog

I'm using a streamwriter to log errors the way it has been designed (please dont ask why) is to open a new streamwriter everytime the application has to log a message. It outputs everything to ./Logs/[current-date].txt which usually resolves to "c:\myappfolder\logs[current-date].txt" Everything works correctly, but after I use an open ...

Select either a file or folder from the same dialog in .NET

Is there an "easy" way to select either a file OR a folder from the same dialog? In many apps I create I allow for both files or folders as input. Until now i always end up creating a switch to toggle between file or folder selection dialogs or stick with drag-and-drop functionality only. Since this seems such a basic thing i would im...

GetOpenFileName change directory

Question: Does anyone know how to change the current directory of an already running open file dialog? Details: I have a customized open file dialog (using a custom template to add extra controls) that also has all the validation, existing checks, and creation tests turned off (via the OpenFileName flags). Turning those things off di...

C# OpenFileDialog Non-Modal possible

Is it possible to create/have a non-modal .net OpenFileDialog I have a UI element in the main dialog which always need to be available for the user to press. ...

Marshalling an an unmanaged array of strings from a PInvoked OpenFileDialog (GetOpenFileName)

OpenFileDialog returns a pointer to memory containing a sequence of null-terminated strings, followed by final null to indicate the end of the array. This is how I'm getting C# strings back from the unmanaged pointer, but I'm sure there must be a safer, more elegant way. IntPtr unmanagedPtr = // start of the array ... ...

Replacing OpenFileDialog / SaveFileDialog in .net

In the application I'm working on, I've been trying to use the SaveFileDialog and OpenFileDialog for their customary purpose (saving and opening files.) However, the application can't support modal forms/dialogs without crashing because too many time-sensitive things happen on the thread that owns the UI. Rewriting the application to m...

C# Making the second and third OpenFileDialog appear above the console?

I'm writing a console program that can accept 1 to 3 files. I'm using OpenFileDialog three times to accept the files, but the second time and third the file dialog is behind the console window, making it hard to notice. Any way to get it to appear above? An image of the problem: http://img205.imageshack.us/img205/5312/problemr.png The ...

How to make OpenFileDialog accept "valid" URIs

I need to use OpenFileDialog to input a URI or local path. The problem is that the schema of the URL is not something windows knowns about (or should know about because it's a hack for testing). I can turn off all validation and as long as I don't feed it a invalid chars it returns but then it will happily eat anything else and that isn...

Excluding file extensions from open file dialog in C#.

I am trying to put a filter on my C# openFileDialog that excludes certain file extensions. For example I want it to show all files in a directory that are not .txt files. Is there a way to do this? ...

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 = Directory.GetCurrentDirectory(); //<-- correct if (open.ShowDialog() == DialogResult.OK) //-- select a file on my d...

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 such API provided to accomplish this, is it possible to use some hooking technique, but th...

How do I browse the local directory's files without using OpenFileDialog? (C#)

Hi There, I want to build something where the user to browse the local files on the application I am providing, the screen is actually identical to OpenFileDialog, but I do not want that to be a dialog but a control on my form. I tried to use a Web Browser control, it works, but I have to write a bunch of navigation code in order for t...

GetOpenFileName lpstrInitialDir (directory)... not working for URL (SharePoint)

I bring up a GetOpenFileName dialog, enter a URL to a SharePoint sever, and it lets me browse that server using the Web Client Service (WebDAV mini-redirector). I am trying to get the initial directory to come up as that URL, but it seems to ignore it (using OPENFILENAME struct's lpstrInitialDir. Local paths work fine. EDIT: Paul re...

Visual Basic, Opening a file, what is wrong with my code?

Hi all, The 'reader' within the if statement is showing "Expression is not a method", what am I doing wrong? Thanks Dim reader As New CSVReader OpenFileDialog2.Filter = "CSV File (*.csv)|*.csv" OpenFileDialog2.RestoreDirectory = True If OpenFileDialog2.ShowDialog() = DialogResult.OK Then reader(O...

Invalid Pointer Operation

I have a form that contains a TOpenDialog component (OpenDialog1) and a button. OpenDialog1 has the ofAllowMultiSelect (of Options) property set to true. Upon clicking the button the method AddFilesToListView is executed: procedure TForm4.AddFilesToListView(); var ListItem : TListItem; I: Integer; F : File; LengthOfAudio : TDat...