public FormOptions(FormStart formStart) { InitializeComponent(); this.StartPosition = FormStartPosition.Manual; this.Left = Top = 0; this.Width = Screen.PrimaryScreen.WorkingArea.Width; this.Height = Screen.PrimaryScreen.WorkingArea.Height; this.KeyPreview = true; _formStart = formStart; _formUserManagement = new FormUserManagement(_formStart, this); foreach (Control control in Controls) { if (control.Name == "btnUserManagement") { break; } control.MouseClick += OnAnyMouseClick; } // Close keypad upon selection of most components foreach (Control control in Controls) { if (control != tbxPin && control != tbxNewPhone && control != btnClearTextBox && control != tbxNewName) { control.MouseClick += keyboardClose_Leave; } } this.MouseClick += keyboardClose_Leave; }
public FormUserManagement(FormStart formStart, FormOptions formOptions) { InitializeComponent(); _formStart = formStart; _formOptions = formOptions; this.StartPosition = FormStartPosition.Manual; this.Left = Top = 0; this.Width = Screen.PrimaryScreen.WorkingArea.Width; this.Height = Screen.PrimaryScreen.WorkingArea.Height; this.KeyPreview = true; // Close keypad upon selection of most components foreach (Control control in Controls) { if (control != tbxPin && control != tbxUserPhone && control != btnClearTextBox && control != tbxUserName) { control.MouseClick += keyboardClose_Leave; } } this.MouseClick += keyboardClose_Leave; }