private void CargaInicial_Load(object sender, EventArgs e) { try { circularProgressBar1.Value = 0; circularProgressBar1.Minimum = 0; circularProgressBar1.Maximum = 500; TimerInicio.Start(); TimerMensajes.Start(); TimerCierre.Start(); } catch (Exception ex) { this.Hide(); MessageBox.Show("Error al intertar cargar datos. \r" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(0); } }
private void IniciarJogo() { foreach (Control control in Table.Controls) { Label iconLabel = control as Label; if (iconLabel != null) { if (icons.Count > 0) { int randomNumber = random.Next(icons.Count); iconLabel.Text = icons[randomNumber]; icons.RemoveAt(randomNumber); } } } TimerInicio.Start(); }
private void Timer1_Tick(object sender, EventArgs e) { try { if (this.Opacity < 1) { this.Opacity += 0.05; //Opacity trabaja en procentaje 1 es 100% } circularProgressBar1.Value += 1; if (circularProgressBar1.Value == 500) { circularProgressBar1.Value = 0; TimerInicio.Stop(); TimerInicio.Start(); } } catch (Exception ex) { throw ex; } }