cancel buttons should set dialog result to Cancel

This commit is contained in:
Robert McRackan 2021-07-15 17:14:45 -04:00
parent 3c1c718bc7
commit 5d6e3ea3f3
6 changed files with 31 additions and 47 deletions

View File

@ -94,7 +94,11 @@ namespace LibationWinForms.Dialogs
}
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
class AccountDto
{

View File

@ -59,7 +59,11 @@ namespace LibationWinForms.Dialogs
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

View File

@ -22,6 +22,9 @@ namespace LibationWinForms.Dialogs
private void LibationFilesDialog_Load(object sender, EventArgs e)
{
if (this.DesignMode)
return;
libationFilesDescLbl.Text = desc(nameof(config.LibationFiles));
this.libationFilesRootRb.Text = "In the same folder that Libation is running from\r\n" + Configuration.AppDir;
this.libationFilesMyDocsRb.Text = "In My Documents\r\n" + Configuration.MyDocs;
@ -62,6 +65,10 @@ namespace LibationWinForms.Dialogs
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

View File

@ -64,6 +64,10 @@ namespace LibationWinForms.Dialogs
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

View File

@ -19,6 +19,9 @@ namespace LibationWinForms.Dialogs
private void SettingsDialog_Load(object sender, EventArgs e)
{
if (this.DesignMode)
return;
this.booksLocationDescLbl.Text = desc(nameof(config.Books));
this.downloadsInProgressDescLbl.Text = desc(nameof(config.DownloadsInProgressEnum));
this.decryptInProgressDescLbl.Text = desc(nameof(config.DecryptInProgressEnum));
@ -90,6 +93,10 @@ namespace LibationWinForms.Dialogs
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

View File

@ -17,41 +17,11 @@
</ItemGroup>
<ItemGroup>
<Compile Update="Dialogs\Login\MfaDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Dialogs\Login\MfaDialog.Designer.cs">
<DependentUpon>MfaDialog.cs</DependentUpon>
</Compile>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Dialogs\LibationFilesDialog.cs" />
<Compile Update="Dialogs\LibationFilesDialog.Designer.cs">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</Compile>
<Compile Update="Dialogs\Login\ApprovalNeededDialog.cs" />
<Compile Update="Dialogs\Login\ApprovalNeededDialog.Designer.cs">
<DependentUpon>ApprovalNeededDialog.cs</DependentUpon>
</Compile>
<Compile Update="Dialogs\ScanAccountsDialog.cs" />
<Compile Update="Dialogs\ScanAccountsDialog.Designer.cs">
<DependentUpon>ScanAccountsDialog.cs</DependentUpon>
</Compile>
<Compile Update="Dialogs\SettingsDialog.cs" />
<Compile Update="Dialogs\SettingsDialog.Designer.cs">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</Compile>
<Compile Update="Dialogs\IndexLibraryDialog.cs" />
<Compile Update="Dialogs\IndexLibraryDialog.Designer.cs">
<DependentUpon>IndexLibraryDialog.cs</DependentUpon>
</Compile>
<Compile Update="Dialogs\SetupDialog.cs" />
<Compile Update="Dialogs\SetupDialog.Designer.cs">
<DependentUpon>SetupDialog.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -59,18 +29,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Dialogs\LibationFilesDialog.resx">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Dialogs\ScanAccountsDialog.resx">
<DependentUpon>ScanAccountsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Dialogs\SettingsDialog.resx">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="Dialogs\SetupDialog.resx">
<DependentUpon>SetupDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
</Project>