private void uploadPartitionToolStripMenuItem_Click(object sender, EventArgs e) { UserUpload upload = new UserUpload(); upload.StartPosition = FormStartPosition.CenterParent; var result = upload.ShowDialog(this); String filename = "temp.mid"; try { saveIncipitToTrack(); sequencer.Sequence.Save(filename); if (result == DialogResult.OK) { uploadPartition(upload, filename); } } catch (Exception exception) { MessageBox.Show("Error during upload: " + exception.Message); } }