//Metodo Constructor public principal(string Nombre, string Matricula) { InitializeComponent(); nom = Nombre; mat = Matricula; label2.Text = Nombre; Nombre = Nombre.ToLower(); this.Nombre = Nombre; this.Matricula = Matricula; label3.Text = Matricula; //Ingresamos el nombre a la lista for (int i = 0; i < Nombre.Length; i++) { if (!Nombre[i].Equals(' ')) { alfabeto.Add(Nombre[i]); } } //Ingresamos la matricula a la lista for (int i = 0; i < Matricula.Length; i++) { if (!Matricula[i].Equals(' ')) { alfabeto.Add(Matricula[i]); } } //Ingresamos el punto a la lista alfabeto.Add('.'); //Mandamos a validar el alfabeto(no repetidos,no espacios) Metodos met = new Metodos(); met.ObtenerAlfabeto(alfabeto); //Mandamos llamar al metodo que hace posible la visualizacion labelAlfabeto.Text = "{" + met.AlfabetoVisible(alfabeto) + "}"; }
private void pictureBox1_Click(object sender, EventArgs e) { string verificar = CadenaVerificar.Text; Console.WriteLine("Longitud de cadena a verificar:" + verificar.Length); Metodos met = new Metodos(); //Llamamos las funciones para validar las condiciones SoloEnAlfabeto = met.EnAlfabeto(verificar, alfabeto); PrimeraCondicion = met.PrimerSimboloDigito(alfabeto, verificar); TerceraCondicion = met.ContieneTodasLasIniciales(Nombre, verificar); CuartaCondicion = met.ElFinalDeLaCadena(verificar, Matricula, alfabeto); QuintaCondicion = met.NoPuntosSeguidos(verificar, alfabeto); //Muestra los elementos escondidos tablaCondiciones.Show(); imgCondicion1.Show(); imgCondicion2.Show(); imgCondicion3.Show(); imgCondicion4.Show(); imgCondicion5.Show(); //Muestra los labels escondidos labelCondicion1.Show(); label1.Show(); label4.Show(); label6.Show(); label7.Show(); label8.Show(); label8.Text = "\"." + mat + "\""; label9.Show(); if (PrimeraCondicion == true) { imgCondicion1.BackgroundImage = Properties.Resources.palomitaexpandida; } else { imgCondicion1.BackgroundImage = Properties.Resources.tachitaexpandida; } if (SoloEnAlfabeto == true) { imgCondicion2.BackgroundImage = Properties.Resources.palomitaexpandida; } else { imgCondicion2.BackgroundImage = Properties.Resources.tachitaexpandida; } if (TerceraCondicion == true) { imgCondicion3.BackgroundImage = Properties.Resources.palomitaexpandida; } else { imgCondicion3.BackgroundImage = Properties.Resources.tachitaexpandida; } if (CuartaCondicion == true) { imgCondicion4.BackgroundImage = Properties.Resources.palomitaexpandida; } else { imgCondicion4.BackgroundImage = Properties.Resources.tachitaexpandida; } if (QuintaCondicion == true) { imgCondicion5.BackgroundImage = Properties.Resources.palomitaexpandida; } else { imgCondicion5.BackgroundImage = Properties.Resources.tachitaexpandida; } }