E
Edwin
Hello Everyone. Below is the code that is in question.
--- BEGIN CODE WITHIN INHERITED FORM ---
protected virtual void OnFormClosing(object sender, FormClosingEventArgs e)
{
switch (e.CloseReason)
{
case CloseReason.UserClosing:
if (this.AskUserIfOkayToClose() == true)
{ this.ExecuteApplicationCloseProcedures(); }
else
{ e.Cancel = true; }
break;
case CloseReason.ApplicationExitCall:
this.ExecuteApplicationCloseProcedures();
break;
default:
e.Cancel = true;
break;
}
}
}
protected virtual void buttonNext_Click(object sender, EventArgs e)
{
this.ShowRequestedForm(ApplicationVariables.NextWindowForm);
}
private void ShowRequestedForm(System.Windows.Forms.Form FormToShow)
{
ApplicationVariables.CurrentWindowForm = this;
FormToShow.Show();
ApplicationVariables.CurrentWindowForm.Close();
}
--- END CODE WITHIN INHERITED FORM ---
--- BEGIN CODE WITHIN WINDOWS FORM ---
public partial class HomeForm : VerificationsAssistant.InheritedForm
{
protected override void buttonNext_Click(object sender, EventArgs e)
{
// CODE REMOVED
base.buttonNext_Click(sender, e);
}
}
--- END CODE WITHIN WINDOWS FORM ---
The problem is that when the user clicks the "NEXT" button, any code that is
found within the base.buttonNext_Click event is called twice.
I do not understand why. Any help would be greatly appreciated. Thank you!
--- BEGIN CODE WITHIN INHERITED FORM ---
protected virtual void OnFormClosing(object sender, FormClosingEventArgs e)
{
switch (e.CloseReason)
{
case CloseReason.UserClosing:
if (this.AskUserIfOkayToClose() == true)
{ this.ExecuteApplicationCloseProcedures(); }
else
{ e.Cancel = true; }
break;
case CloseReason.ApplicationExitCall:
this.ExecuteApplicationCloseProcedures();
break;
default:
e.Cancel = true;
break;
}
}
}
protected virtual void buttonNext_Click(object sender, EventArgs e)
{
this.ShowRequestedForm(ApplicationVariables.NextWindowForm);
}
private void ShowRequestedForm(System.Windows.Forms.Form FormToShow)
{
ApplicationVariables.CurrentWindowForm = this;
FormToShow.Show();
ApplicationVariables.CurrentWindowForm.Close();
}
--- END CODE WITHIN INHERITED FORM ---
--- BEGIN CODE WITHIN WINDOWS FORM ---
public partial class HomeForm : VerificationsAssistant.InheritedForm
{
protected override void buttonNext_Click(object sender, EventArgs e)
{
// CODE REMOVED
base.buttonNext_Click(sender, e);
}
}
--- END CODE WITHIN WINDOWS FORM ---
The problem is that when the user clicks the "NEXT" button, any code that is
found within the base.buttonNext_Click event is called twice.
I do not understand why. Any help would be greatly appreciated. Thank you!