I have a main form with a save button, when the save button is pressed a MessageBox asks if they would like to save or not. When I select Yes or No I can't seem to get the main form to the top again. If I have other windows opened the main form is put in the background. I've tried this.Focus(), this.BringToFront()
private void btn_Save_Click(object sender, System.EventArgs e)
{
DialogResult result;
result = MessageBox.Show("Save changes?", "Save changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
// update text fields with currentRow data
if(result == DialogResult.Yes)
{
//<does the saving>
}
this.Focus();
}
" ahhh computers, how they made our lives much simpler
"
private void btn_Save_Click(object sender, System.EventArgs e)
{
DialogResult result;
result = MessageBox.Show("Save changes?", "Save changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
// update text fields with currentRow data
if(result == DialogResult.Yes)
{
//<does the saving>
}
this.Focus();
}
" ahhh computers, how they made our lives much simpler