/// <summary> /// Displays a warning to the user that they are about to create a new file. /// </summary> private void DisplayNewFileWarning() { string message = "Are you sure you wish to create a new password File?"; string title = "Pass Keeper"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; //creates a dialog box with the message, title and button options DialogResult confirm = MessageBox.Show(message, title, buttons); //if they want to make a new file if (confirm == DialogResult.Yes) { if (FileOP.GetFile() != "") { DialogResult savePrompt = MessageBox.Show("Would you like to save the current working file?", "Lock Current File", MessageBoxButtons.YesNo); if (savePrompt == DialogResult.Yes) { DataTable dataTable = FileOP.DataGridViewToDataTable(dataGridView1); FileOP.WriteToFile(dataTable); } ClearMem(); } //call the create file method and inflate the next form if (FileOP.CreateFile()) { PasswordOptions passwordOptionsForm; // Creates a passwordOptions form with the correct theme if (darkThemeEnabled) { passwordOptionsForm = new PasswordOptions(Color.White, Color.DarkGray, Color.DarkSlateGray, darkThemeEnabled) { TheParent = this }; } else { passwordOptionsForm = new PasswordOptions(SystemColors.ControlText, SystemColors.Window, SystemColors.Control, darkThemeEnabled) { TheParent = this }; } // Adding all the password options components to the list of components in the master from. // This is done to apply the same theme and text size to all of the forms textBoxes.AddRange(passwordOptionsForm.passwordOptionsTextBoxes); labels.AddRange(passwordOptionsForm.passwordOptionsLabels); this.buttons.AddRange(passwordOptionsForm.passwordOptionsButtons); forms.Add(passwordOptionsForm); // Changing text size of passwordOptions if (defaultTextSizeEnabled) { ChangeFontSize(8.0f); passwordOptionsForm.passwordOptionsDefaultTextSizeEnabled = true; passwordOptionsForm.passwordOptionsSmallTextSizeEnabled = false; passwordOptionsForm.passwordOptionsLargeTextSizeEnabled = false; } else if (smallTextSizeEnabled) { ChangeFontSize(6.0f); passwordOptionsForm.passwordOptionsDefaultTextSizeEnabled = false; passwordOptionsForm.passwordOptionsSmallTextSizeEnabled = true; passwordOptionsForm.passwordOptionsLargeTextSizeEnabled = false; } else if (largeTextSizeEnabled) { ChangeFontSize(10.0f); passwordOptionsForm.passwordOptionsDefaultTextSizeEnabled = false; passwordOptionsForm.passwordOptionsSmallTextSizeEnabled = false; passwordOptionsForm.passwordOptionsLargeTextSizeEnabled = true; } passwordOptionsForm.ShowDialog(); passwordOptionsForm.Activate(); } ; } }