Add FolderPicker to source selection in config menu.
This commit is contained in:
parent
b1368e3c53
commit
f85361ed27
1
ConfForm.Designer.cs
generated
1
ConfForm.Designer.cs
generated
@ -114,6 +114,7 @@ namespace PDF_Merge
|
||||
sourceDirBtn.TabIndex = 7;
|
||||
sourceDirBtn.Text = "...";
|
||||
sourceDirBtn.UseVisualStyleBackColor = true;
|
||||
sourceDirBtn.Click += sourceDirBtn_Click;
|
||||
//
|
||||
// outPathBtn
|
||||
//
|
||||
|
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user