using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace VR2WinApp
{
    public partial class SetAdminPassword : Form
    {
        public string passwd;

        public SetAdminPassword()
        {
            InitializeComponent();
        }

        private void SetAdminPassword_Load(object sender, EventArgs e)
        {
            label3.Text = "";
        }

        private void tbNewPassword1_TextChanged(object sender, EventArgs e)
        {
            if (tbNewPassword.Text != tbNewPassword1.Text)
            {
                label3.Text = "Not Match!";
            }
            else
            {
                label3.Text = "";
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (tbNewPassword.Text.Length == 0 && tbNewPassword.Text.Length == 0)
            {
            }
            else
            {
                if (tbNewPassword.Text != tbNewPassword1.Text)
                {
                    label3.Text = "Not Match!";

                    MessageBox.Show("Password not matched!");

                    return;
                }
            }

            passwd = tbNewPassword.Text;
            DialogResult = DialogResult.OK;
            Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void tbNewPassword_TextChanged(object sender, EventArgs e)
        {
            if (tbNewPassword.Text != tbNewPassword1.Text)
            {
                label3.Text = "Not Match!";
            }
            else
            {
                label3.Text = "";
            }
        }
    }
}
