Example #1
0
 public MasterPasswordGenForm(EntryPassword form)
 {
     InitializeComponent();
     InitializeControlList();
     LowerCase.Enabled        = false;
     currentEntryPasswordform = form;
 }
        /// <summary>
        /// Opens up the password entry options when the user clicks on the password box
        /// </summary>
        private void EntryVariablesPasswordTextBox_Enter_1(object sender, EventArgs e)
        {
            EntryPassword form = new EntryPassword(this);

            // Adding all the Entry Password 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(form.entryPasswordTextBoxes);
            labels.AddRange(form.entryPasswordLabels);
            this.buttons.AddRange(form.entryPasswordButtons);
            forms.Add(form);

            // Changing theme of EntryPassword
            if (darkThemeEnabled)
            {
                ChangeTheme(System.Drawing.Color.White, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkSlateGray);
                form.entryPasswordDarkThemeEnabled = true;
            }
            else
            {
                ChangeTheme(System.Drawing.SystemColors.ControlText, System.Drawing.SystemColors.Window, System.Drawing.SystemColors.Control);
                form.entryPasswordDarkThemeEnabled = false;
            }

            // Changing text size of EntryPassword
            if (defaultTextSizeEnabled)
            {
                ChangeFontSize(8.0f);
                form.entryPasswordDefaultTextSizeEnabled = true;
                form.entryPasswordSmallTextSizeEnabled   = false;
                form.entryPasswordLargeTextSizeEnabled   = false;
            }

            else if (smallTextSizeEnabled)
            {
                ChangeFontSize(6.0f);
                form.entryPasswordDefaultTextSizeEnabled = false;
                form.entryPasswordSmallTextSizeEnabled   = true;
                form.entryPasswordLargeTextSizeEnabled   = false;
            }

            else if (largeTextSizeEnabled)
            {
                ChangeFontSize(10.0f);
                form.entryPasswordDefaultTextSizeEnabled = false;
                form.entryPasswordSmallTextSizeEnabled   = false;
                form.entryPasswordLargeTextSizeEnabled   = true;
            }

            form.ShowDialog();
        }