Esempio n. 1
0
 //An event handler that executes when the "Modify Existing Flash Card" button is pressed
 private void btnModifyExistingFlashCard_Click(object sender, EventArgs e)
 {
     try
     {
         //Showing Dialog to select file
         if (openFileDialog.ShowDialog() == DialogResult.OK)
         {
             //opening and reading the file
             CreateAndModify frm = new CreateAndModify(ReadAndWriteToFile.readFromFile(openFileDialog.FileName),
                                                       openFileDialog.FileName.Split('\\').Last().Split('.').First()); //Gets the just the file name, not full path, and no extention
             //Displaying the 'CreateAndModify' form, with the cards inside of it
             frm.ShowDialog();
         }
     }
     catch (Exception err)
     {
         //Displaying the error that occurred
         MessageBox.Show("Error: " + err);
     }
 }
Esempio n. 2
0
        //An event handler that executes when the "Create Flash Card" button is pressed
        private void btnCreateFlashCard_Click(object sender, EventArgs e)
        {
            CreateAndModify frm = new CreateAndModify();

            frm.ShowDialog();
        }