Delete function: set the default button to be "no"

This commit is contained in:
Thorsten Sommer 2022-07-10 11:19:50 +02:00
parent 187d5b1958
commit aa22f7e1ef
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -159,7 +159,7 @@ public partial class SectionTree : UserControl
var numberChildren = await SectionProcessor.NumberChildren(this.db, selectedNode.Name); var numberChildren = await SectionProcessor.NumberChildren(this.db, selectedNode.Name);
// Ask the user, if he really wants to remove the section: // Ask the user, if he really wants to remove the section:
if(MessageBox.Show(numberChildren > 0 ? $"Are you sure, you want to remove the section '{selectedNode.Text}', its {numberChildren} children and so on?" : $"Are you sure, you want to remove the section '{selectedNode.Text}'?", "Remove section", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) if(MessageBox.Show(numberChildren > 0 ? $"Are you sure, you want to remove the section '{selectedNode.Text}', its {numberChildren} children and so on?" : $"Are you sure, you want to remove the section '{selectedNode.Text}'?", "Remove section", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
return; return;
// Remove the section from the database: // Remove the section from the database: