Beispiel #1
0
        private void UsernameSetup()
        {
            int Ux = UsernameButton.Location.X, Uy = UsernameButton.Location.Y;
            int Px = PasswordButton.Location.X, Py = PasswordButton.Location.Y;

            Label emailLabel = new Label();

            emailLabel.Name     = "EmailLabel";
            emailLabel.Text     = "Email";
            emailLabel.Location = new Point(Ux + emailLabel.Text.Length * 3, Uy + emailLabel.Text.Length * 3);
            emailLabel.Size     = new Size(159, 22);
            emailLabel.Anchor   = AnchorStyles.Left;
            emailLabel.AutoSize = true;
            emailLabel.Font     = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            Controls.Add(emailLabel);

            textBox          = new TextBox();
            textBox.Name     = "EmailTextBox";
            textBox.Location = new Point(Px / 5 - emailLabel.Text.Length, Py);
            textBox.Text     = string.Empty;
            textBox.Size     = new Size(259, 22);
            textBox.Anchor   = AnchorStyles.Left;
            textBox.Font     = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            Controls.Add(textBox);

            UsernameButton.Dispose();
            PasswordButton.Dispose();

            emailLabel.Show();
            textBox.Show();

            Password = false;
        }
Beispiel #2
0
        private void PasswordSetup()
        {
            int Ux = UsernameButton.Location.X, Uy = UsernameButton.Location.Y;
            int Px = PasswordButton.Location.X, Py = PasswordButton.Location.Y;

            Label usernameLabel = new Label();

            usernameLabel.Name     = "UsernameLabel";
            usernameLabel.Text     = "Username";
            usernameLabel.Location = new Point(Ux + 3, Uy + usernameLabel.Text.Length * 3);
            usernameLabel.Size     = new Size(159, 22);
            usernameLabel.Anchor   = AnchorStyles.Left;
            usernameLabel.AutoSize = true;
            usernameLabel.Font     = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            Controls.Add(usernameLabel);

            textBox          = new TextBox();
            textBox.Name     = "UsernameTextBox";
            textBox.Location = new Point(Px - PasswordButton.Size.Width / 2, Py);
            textBox.Text     = string.Empty;
            textBox.Size     = new Size(159, 22);
            textBox.Anchor   = AnchorStyles.Left;
            textBox.Font     = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            Controls.Add(textBox);

            UsernameButton.Dispose();
            PasswordButton.Dispose();

            usernameLabel.Show();
            textBox.Show();

            Password = true;
        }