private void timer1_Tick(object sender, EventArgs e) { progressBar1.Increment(1); if (progressBar1.Value == progressBar1.Maximum) { timer1.Stop(); this.Hide(); FormInc frm = new FormInc(); frm.Show(); } }
private void btnlogin_Click(object sender, EventArgs e) { frm.TablaPersona.ReadXml(NombreArchivo); for (int i = 0; i < frm.TablaPersona.Rows.Count; i++) { if (textBox1.Text == frm.TablaPersona.Rows[i][0].ToString() && textBox3.Text == frm.TablaPersona.Rows[i][1].ToString() && comboBox1.Text == frm.TablaPersona.Rows[i][3].ToString()) { MessageBox.Show("Bienvenido " + textBox1.Text, caption: "Inicio de sesion correcto", MessageBoxButtons.OK); FormInc f2 = new FormInc(); //pones la instancia y te apareceran los campos que desees mandar f2.label1.Text = textBox1.Text; f2.label2.Text = " Profesor"; //muestras el formulario al que se enviaron los datos this.Hide(); f2.Show(); Form5 frm2 = new Form5(); Z = frm.TablaPersona.Rows[i][3].ToString(); } else if (textBox1.Text != frm.TablaPersona.Rows[i][0].ToString() && textBox3.Text != frm.TablaPersona.Rows[i][1].ToString() && comboBox1.Text != frm.TablaPersona.Rows[i][3].ToString()) { MessageBox.Show("Datos Incorrectos", caption: "Error de inicio de sesion", MessageBoxButtons.OK); } else if (textBox1.Text == frm.TablaPersona.Rows[i][0].ToString() && textBox3.Text != frm.TablaPersona.Rows[i][1].ToString() && comboBox1.Text != frm.TablaPersona.Rows[i][3].ToString()) { MessageBox.Show("Datos Incorrectos", caption: "Error de inicio de sesion", MessageBoxButtons.OK); } else if (textBox1.Text != frm.TablaPersona.Rows[i][0].ToString() && textBox3.Text == frm.TablaPersona.Rows[i][1].ToString() && comboBox1.Text != frm.TablaPersona.Rows[i][3].ToString()) { MessageBox.Show("Datos Incorrectos", caption: "Error de inicio de sesion", MessageBoxButtons.OK); } else if (textBox1.Text != frm.TablaPersona.Rows[i][0].ToString() && textBox3.Text == frm.TablaPersona.Rows[i][1].ToString() && comboBox1.Text == frm.TablaPersona.Rows[i][3].ToString()) { MessageBox.Show("Datos Incorrectos", caption: "Error de inicio de sesion", MessageBoxButtons.OK); } break; } }