views:

1913

answers:

5

(Note: I am using Delphi 7)

Does anyone know if it is possible to embed a file open dialog inside your own form?

We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combo box, places bar, shell file list, file name combo edit with name completion etc etc.

I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components

I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\suggestion

Any idea?

Thanks

+4  A: 

I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest "recreating the dialog with some 3rd party components" but with VirtualShellTools. (At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.

utku_karatas
+2  A: 

The places bar is not that difficult to implement using a TListView component set to large icons. The Raize Components library also has some source that would help in this arena.

skamradt
+2  A: 

Just a small note, it's fairly easy to add an auto-completing combobox with SHAutoComplete.

See this article for details.

stg
+1  A: 

I would re-create it: it shouldn't take long with the VCL Components. The autocomplete is not hard, and you can get the rest of the data if you look through the windows docs long enough.

You can try and cheat by detecting the tab change and displaying the open dialog as if it were the tab page. You will have to detect the user clicking outside of the dialog (e.g. on a different tab) and prevent it closing until you want to change tabs.

Cheers

Richard Haven
+1  A: 

Maybe this can help you.

Ulrich Gerhardt