private void ExportButton_Click(object sender, EventArgs e) { try { if (sender == btnExport) { ActiveChild.ExportAndCloseAsync(); } else if (sender == btnExportAll) { foreach (var form in Children) { form.ExportAndCloseAsync(); } } } //Do not remove the catch scope catch (Exception ex) { ex.ThrowAndForget(); } }