//Load event private void loadToolStripMenuItem_Click(object sender, EventArgs e) { //create an open file dialog var loadFileDialog = new OpenFileDialog(); //if the user selects a file and hits okay if (loadFileDialog.ShowDialog() == DialogResult.OK) { //Clear the spreadsheet ClearSpreadsheet(); //create stream to load the file into Stream infile = new FileStream(loadFileDialog.FileName, FileMode.Open, FileAccess.Read); //load the file into the spreadsheet spreadsheet.Load(infile); //Close the stream so we can use it infile.Dispose(); //Clear the undo and redo stacks undoRedo.ClearStacks(); } //update the edit menu UpdateEditMenu(); }