I have two forms that are very similar, but in one of them clicking the AcceptButton
closes the form, and in the other it doesn't close the form. Both of them have their AcceptButton
set to btnAccept
.
I recently created the second one, the first one has existed for awhile and was created by someone else.
They are both opened this way:
using(var form = new SomeDialog(dependency))
{
form.StartPosition = FormStartPosition.CenterParent;
form.ShowDialog(this);
}
Both of them handle the accept button click along these lines.
private void btnAccept_Click(object sender, EventArgs e)
{
_dependency.DoSomething(userInput);
}
Posting my entire designer file probably wouldn't be helpful. Is there something in particular that'd be helpful to show from it? I couldn't find a similar post on StackOverflow.
What am I missing that's causing the divergent behavior?