private void button1_Click(object sender, EventArgs e) { //Input error checking if (string.IsNullOrWhiteSpace(total_memory.Text) || string.IsNullOrWhiteSpace(method_box.Text) || string.IsNullOrWhiteSpace(no_of_holes.Text)) { System.Windows.Forms.MessageBox.Show("You can't leave any field empty, please fill all fields."); return; } totalMemorySize = int.Parse(total_memory.Text); method = method_box.Text; noOfHoles = int.Parse(no_of_holes.Text); if (totalMemorySize < 0 || noOfHoles < 0) { System.Windows.Forms.MessageBox.Show("Total memory size & number of holes must be greater than 0"); return; } if (totalMemorySize == 0) { System.Windows.Forms.MessageBox.Show("This is a memory management simulator, are you sure the memory size is 0?"); return; } ////////////////////// Holes_Info next_form = new Holes_Info(noOfHoles, method, totalMemorySize); next_form.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { Holes_Info rewind_2 = new Holes_Info(backup_no_of_holes, method, total_memory_size); rewind_2.Show(); this.Hide(); }