Made sure the OK and Cancel buttons set the DialogResult just before closing the form

This commit is contained in:
John Jenko 2012-02-23 15:44:47 +00:00
parent 5649e60d69
commit 92e7711be0
3 changed files with 5 additions and 2 deletions

View File

@ -283,7 +283,6 @@ namespace VEPROMS
{
folderConfigBindingSource.EndEdit();
DialogResult = DialogResult.OK;
// Save Default settings for User
//
// Save whether we should display the default values on this property page
@ -291,12 +290,14 @@ namespace VEPROMS
Settings.Default.Save();
_FolderConfig.MyFolder.Config = _FolderConfig.ToString();
_FolderConfig.MyFolder.Save().Dispose();
DialogResult = DialogResult.OK;
this.Close();
}
private void ppBtnCancel_Click(object sender, EventArgs e)
{
folderConfigBindingSource.CancelEdit();
DialogResult = DialogResult.Cancel;
this.Close();
}

View File

@ -60,7 +60,6 @@ namespace VEPROMS
private void ppBtnOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
procedureConfigBindingSource.EndEdit();
// Save Default settings for User
//
@ -70,6 +69,7 @@ namespace VEPROMS
_ProcedureConfig.MyProcedure.Save().Dispose();
SaveText(ppProcTitleStpRTB);
SaveText(ppProcNumStpRTB);
DialogResult = DialogResult.OK;
this.Close();
}
public void SaveText(StepRTB myStepRTB)
@ -88,6 +88,7 @@ namespace VEPROMS
private void ppBtnCancel_Click(object sender, EventArgs e)
{
procedureConfigBindingSource.CancelEdit();
this.DialogResult = DialogResult.Cancel;
this.Close();
}

View File

@ -100,6 +100,7 @@ namespace VEPROMS
Settings.Default.PropPageStyle = 3;
Settings.Default.Save();
this.DialogResult = DialogResult.OK;
this.Close();
}