folderbrowserdialog

Vb.net - FolderBrowserDialog

谁说我不能喝 提交于 2019-12-13 02:26:38
问题 I am having some troubles with FolderBrowserDialog I've tried all the post I could find here and I'm almost there in terms of what I want. following is my code: Private Sub ButtonBrowseOutput_Click(sender As Object, e As EventArgs) Handles ButtonBrowseOutput.Click Dim dialog = New FolderBrowserDialog() dialog.SelectedPath = Application.StartupPath If DialogResult.OK = dialog.ShowDialog() Then TextBoxShowOutput.Text = dialog.ToString & "/helloforum" & ".txt" End If End Sub would give me

Get network path not drive letter from FolderBrowserDialog

ε祈祈猫儿з 提交于 2019-12-12 17:06:08
问题 I have a winform with a FolderBrowserDialog to choose a folder from a network drive. The issue is that it returns the drive letter ( X:\Folder... ) rather than the network path ( \\Network\Projects\Folder... ). How can I get the network path? 回答1: Quick and dirty code that will show the path as a network path in a MessageBox. You may want to add additional checks and/or restructure this a bit. var dialog = new OpenFileDialog(); dialog.ShowDialog(); var path = dialog.FileName; using (var

C# OpenFileDialog Thread start but dialog not shown

你说的曾经没有我的故事 提交于 2019-12-12 12:47:27
问题 I am trying to finish my static Prompt class to be able to call it from anywhere. But the problem is couldn't make the dialog show. I am already using [STAThread] and here is my code. public static string ShowFileDialog() { string selectedPath = ""; var t = new Thread((ThreadStart)(() => { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.RootFolder = System.Environment.SpecialFolder.MyComputer; fbd.ShowNewFolderButton = true; if (fbd.ShowDialog() == DialogResult.OK) { selectedPath =

C# How to allow selection of My Computer with folderBrowserDialog

荒凉一梦 提交于 2019-12-12 12:17:23
问题 In my application, I want the folderBrowserDialog to allow selection of My Computer . But the OK button gets disabled after selecting My Computer from the dialog box. Is there any way to allow the selection of My Computer in Browse Dialog ? 回答1: My Computer (or This PC in more recent Windows versions) is a special folder (not a file system folder), and the standard FolderBrowserDialog class does not support it. Here is a replacement sample FolderBrowser class that allows the user to select

selecting files and saving it to the defined location using folder browse dialog

别来无恙 提交于 2019-12-11 14:22:46
问题 I had made this code for user to select a folder so that my two files will be copied to that. The code is this: string sourcePath = @"C:\Documents and Settings\akib\"; string fileName1 = @"untitled.jpg"; string fileName2 = @"Copyuntitled.jpg"; DialogResult result = folderBrowserDialog1.ShowDialog(); if (result == DialogResult.OK) { var destinationFolderName = folderBrowserDialog1.SelectedPath; if (Directory.Exists(destinationFolderName)) { File.Copy(sourcePath + "/" + fileName1,

Folder chooser on Windows

让人想犯罪 __ 提交于 2019-12-11 12:35:21
问题 How can I call the folder default windows folder chooser. I'm using the call: QString path = QFileDialog::getExistingDirectory(parent, "", folder, QFileDialog::ShowDirsOnly); But this call show the dialog below: How can I choose this dialog as folder chooser? 回答1: You did everything correctly. I just tested this on an XP with Qt 4.7.0 and it works as you expect but when testing on Windows 8 with Qt 5.0.2, I get the ordinary file open dialog. I suggest you log this as a bug. 来源: https:/

FolderBrowserDIalog doesn't show network drives in Win 2012

别来无恙 提交于 2019-12-11 12:15:14
问题 I have an application, that uses a folderBrowserDialog. In Windows XP it works fine, but in Win 2012 dialog doesn't show Network Drives. I've tried to find a solution, but failed. Maybe somebody has had the same issue. Any help would be appreciated) 回答1: See this link (I know it mentions Windows 8...but 2012 shares the same kernel): http://social.msdn.microsoft.com/Forums/windows/en-US/f0073f80-cedb-4b7a-96b9-20e4b22c2424/folderbrowserdialog-does-not-show-network-drives-on-windows-8 You could

Using FolderBrowserDialog on a Removable Device / Removable storage

陌路散爱 提交于 2019-12-09 03:34:32
问题 I'm working on a simple copy tool to copy files off digital cameras. I've written the file copy code, I've got everything hooked up nicely. The issue I have seems to be with the FolderBrowserDialog. In Vista (I haven't checked XP yet), I can browse to the directories on the camera. However the FolderBrowserDialog will not let me select a directory on the camera. The OK button is greyed out. Looking at the path for the files on the camera it looks like this: Computer\[Camera Name]\Removable

Failed to set the specified COM apartment state

99封情书 提交于 2019-12-07 09:23:00
问题 It seems that I really am not good with multithreaded applications. I am trying to open a FolderBrowserDialog , but I was getting an exception telling me: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. I have STAThreadAttribute set in my Main method, but the FolderBrowserDialog is being called from a thread other than my main thread. I tried Thread.CurrentThread.SetApartmentState(ApartmentState.STA); but that gave the exception Failed to set the

FolderBrowserDialog in wpf c#

删除回忆录丶 提交于 2019-12-07 09:16:16
问题 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 ? 回答1: You can use the FolderBrowserDialog ; either explicitly place the namespace in front of the class... System.Windows.Forms.FolderBrowserDialog browse = new System