private void button2_Click(object sender, EventArgs e) { var fd = new FolderBrowser2 { }; //new FolderBrowserDialog { }; if (fd.ShowDialog(this) == DialogResult.OK) { if (fd.DirectoryPath.Trim().Length == 0) { return; } tbScanD.Text = fd.DirectoryPath.Trim(); } ButtonSaveAvailability(); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { FolderBrowser2 browser = new FolderBrowser2(); if (value != null) { browser.DirectoryPath = string.Format("{0}", value); } if (browser.ShowDialog(null) == DialogResult.OK) { return(browser.DirectoryPath); } return(value); }
private void button1_Click(object sender, EventArgs e) { /*var fd = new FolderBrowserDialog { }; * fd.ShowDialog(); * if (fd.SelectedPath.Trim().Length == 0) * { * return; * } * tbPotD.Text = fd.SelectedPath.Trim();*/ var fd = new FolderBrowser2 { }; if (fd.ShowDialog(this) == DialogResult.OK) { if (fd.DirectoryPath.Trim().Length == 0) { return; } tbPotD.Text = fd.DirectoryPath.Trim(); } }