Hey I am trying to create an folder browser that will allow you to select the folders and files and "open" them so the path get saved into a richtextbox.
this is my code.
the open thingy worksCode:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Collections; namespace Windows_Tools { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private Hashtable extendees; private void btn_backup_Click_1(object sender, EventArgs e) { FolderBrowserDialog f_browser = new FolderBrowserDialog(); DialogResult result = f_browser.ShowDialog(); Control btn = sender as Control; extendees = new Hashtable(); if (result == DialogResult.OK) { foreach (DictionaryEntry ent in extendees) { if (ent.Value == btn) { Control target = ent.Key as Control; test.Text = f_browser.SelectedPath; return; } } } else { MessageBox.Show("Operation was aborted", "Error:"); } } } }
I need your help to get it to copy the path into my richtextbox.





Reply With Quote