Add FolderPicker to source selection in config menu.
This commit is contained in:
18
ConfForm.cs
18
ConfForm.cs
@@ -44,14 +44,16 @@ namespace PDF_Merge
|
||||
if (sourceBox.Text.Length > 0)
|
||||
{
|
||||
appSettings.Settings["PDF-Path"].Value = sourceBox.Text;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Source path cannot be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
if (outputBox.Text.Length > 0)
|
||||
{
|
||||
appSettings.Settings["PDF-Output"].Value = outputBox.Text;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Output path cannot be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
@@ -60,5 +62,17 @@ namespace PDF_Merge
|
||||
ConfigurationManager.RefreshSection("appSettings");
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void sourceDirBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var SourceDirPicker = new FolderBrowserDialog())
|
||||
{
|
||||
if(SourceDirPicker.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var sourceDir = SourceDirPicker.SelectedPath;
|
||||
sourceBox.Text = sourceDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user