private void frmError_Load(object sender, EventArgs e)
 {
     Console.Read();
     while (this.Visible == true)
     {
         frmDashboard frmDashboard = new frmDashboard(Text);
         frmDashboard.Visible = false;
     }
 }
        public void btnGuardar_Click(object sender, EventArgs e)

        {
            string username = txtUsuario.Text;
            string password = txtpassword.Text;
            string errorx   = string.Format("Ningun campo puede estar vacio");

            if (txtpassword.TextLength == 0)
            {
                frmError frmerror = new frmError(errorx);
                frmerror.Visible = true;
            }

            if (txtUsuario.TextLength == 0)
            {
                frmError frmError = new frmError(errorx);
                frmError.Visible = true;
            }


            //{
            //frmdashboard.Visible = false;
            //}

            else
            {
                this.Hide();
            }
            frmDashboard frmDashboard = new frmDashboard(Text);

            frmDashboard.Visible = true;



            //frmDashboard frmDashboard = new frmDashboard();
            // Not Close()!
            // frmDashboard frmDashboard = new frmDashboard(Text);
            //frmDashboard.Show();
        }