folderbrowserdialog

IFileSaveDialog - choosing folders in Windows 7

ε祈祈猫儿з 提交于 2019-12-07 04:08:16
问题 In Vista, I have been using an IFileSaveDialog to let users pick a "save-as" folder. Users export a folder of images, say, and need to choose a new or existing target folder. Briefly, the code goes like this: IFileSaveDialog* dialog; // created dialog->SetOptions(FOS_PICKFOLDERS); dialog->Show(NULL); dialog->GetResult(&shellItem) In Windows 7, the FOS_PICKFOLDERS option appears to have been disallowed (and is marked as such in the API). The return value on the SetOptions call is E_INVALIDARG

Can I change the title of my FolderBrowserDialog?

眉间皱痕 提交于 2019-12-06 16:53:59
问题 I'm curious and it could give my little app a nice finishing touch. Thanks! 回答1: You can't if you use the class FolderBrowserDialog directly. But I read somewhere that it could be possible to change the title with P/Invoke and sending WM_SETTEXT message. In my opinion, it is not worth the pain. Just use the property Description to add the information: FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = "Select the document folder"; 回答2: The simple answer is that you can't.

Restricted FolderBrowserDialog, recommended solution

我与影子孤独终老i 提交于 2019-12-06 10:54:57
问题 We want to prevent the user from doing anything except selecting a folder. We don't want to allow him to delete files/folders, rename them, access the context menu, etc. But we can't override anything since FolderBrowserDialog is sealed. We googled around and found some solutions: Implement our own FolderBrowserDialog: Don't have time for this, only acceptable as last resort This guy did it for an OpenFileDialog, might work but seems a little overkill Anyone faced this problem and found an

How can I use the Browse for Folder dialog from a WPF app on Windows Server Core?

蹲街弑〆低调 提交于 2019-12-06 07:54:39
I've tried using the FolderBrowserDialog and that seems to work on my development machine. However, this is not supported on a Windows 2008 R2 Server Core . I tried running this code anyway - the dialog appears, but the main display pane is not available. I've also tried using Windows shell32 API (SHBrowseForFolder) with the exact same results. ComDlg32 GetOpenFileName seems to work fine for selecting a file. Not sure what else to try. There have been questions about why this is necessary. I agree with the sentiment. I did not give away a lot of details about the what and the why, and this is

FolderBrowserDialog in wpf c#

谁都会走 提交于 2019-12-05 16:55:48
I am using System.Windows; and System.Windows.Controls; so I can't use System.Windows.Forms; because there is a lot of controls like messagebox and list box...etc are common between them is there another solution to get folderbrowserdialog without using System.Windows.Forms; or is there any get folder location dialog box ? You can use the FolderBrowserDialog ; either explicitly place the namespace in front of the class... System.Windows.Forms.FolderBrowserDialog browse = new System.Windows.Forms.FolderBrowserDialog(); ...or create an alias with regard to your namespace. Imports [ aliasname = ]

Can I change the title of my FolderBrowserDialog?

我们两清 提交于 2019-12-04 22:28:32
I'm curious and it could give my little app a nice finishing touch. Thanks! You can't if you use the class FolderBrowserDialog directly. But I read somewhere that it could be possible to change the title with P/Invoke and sending WM_SETTEXT message. In my opinion, it is not worth the pain. Just use the property Description to add the information: FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = "Select the document folder"; The simple answer is that you can't. The dialog displays using the standard title for a folder browser style dialog on Windows. The best option is to

Restricted FolderBrowserDialog, recommended solution

送分小仙女□ 提交于 2019-12-04 18:02:50
We want to prevent the user from doing anything except selecting a folder. We don't want to allow him to delete files/folders, rename them, access the context menu, etc. But we can't override anything since FolderBrowserDialog is sealed. We googled around and found some solutions: Implement our own FolderBrowserDialog: Don't have time for this, only acceptable as last resort This guy did it for an OpenFileDialog, might work but seems a little overkill Anyone faced this problem and found an optimal solution for this? It must be .NET 4.0 compatible You best bet is to use a control like

C# - WPF - getting folder browser dialog without using System.Windows.Forms?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 17:21:07
问题 I have this WPF app and I want to have there function of getting a directory path from the user. I would like to use some folder browser dialog but I don't want to implement it from System.Windows.Forms or use some huge script inside. Is there some path getting dialog in WPF already implemented? I have read answers to similar questions here but it was full of System.Windows.Forms.. I haven't found anything like that in the Toolbox and I'm starting with WPF so I could use some help. Thank you

DialogResult with FolderBrowserDialog in WPF

时光怂恿深爱的人放手 提交于 2019-12-04 03:02:03
问题 First time I'm implementing a FolderBrowserDialog in WPF and I'm not loving it one bit... Aside from the issues I had figuring out that Windows.Forms wasn't referenced in my project, now I'm having trouble trying to see what the DialogResult return value is... With an OpenFileDialog, in the past I've done it thusly: OpenFileDialog ofd = new OpenFileDialog(); Nullable<bool> result = ofd.ShowDialog(); if (result == true) { // all went well, carry on and do your thing here } Unfortunately, I'm

How do I present an open folder selection dialog in Perl?

旧城冷巷雨未停 提交于 2019-12-03 20:26:14
How do I open folder selection dialog in Perl? Depends on the GUI system you're using, and perhaps the platform. For example, on Windows and using Win32::GUI , you can use GetOpenFileName : # $main is your main window... $my_file = $main->GetOpenFileName( -title => 'Select a file...', -file => 'default.file', ); Most portable (at least compared to ot he rs ): use Tk; my $dir = Tk::MainWindow->new->chooseDirectory; Of course, if you're actually using Tk in the rest of your program, you should call chooseDirectory on a proper parent widget instead of the one constructed and destructed here. You