Example #1
0
        private void txtUsername_Leave(object sender, EventArgs e)
        {
            if (txtUsername.Text == "")
            {
                txtUsername.Text = "Username...";
            }
            else
            {
                picUsernameStatus.Image = Properties.Resources.spinningWheel;

                RegisterModel registerModel = new RegisterModel();
                bool taken = registerModel.checkUsername(txtUsername.Text);

                picUsernameStatus.Visible = true;

                if (!taken) {
                    picUsernameStatus.Image = Properties.Resources.small_tick;
                }
                else
                {
                    picUsernameStatus.Image = Properties.Resources.small_cross;
                    lblUsernameTaken.Visible = true;
                }

            }
        }