Exemplo n.º 1
0
        private void Progress(object novo)
        {
            try
            {
                ProgressBarMeu bar = novo as ProgressBarMeu;
                if (bar == null || bar.Equals(null))
                {
                    invokeCircularProgressBar();
                    return;
                }

                for (bar.Value = 0; bar.Value < bar.Maximum; bar.Value = bar.Value + 3)
                {
                    Invoke((Action) delegate
                    {
                        label5.Text = bar.Value.ToString();
                    });
                    Thread.Sleep(100);
                }

                Invoke((Action) delegate
                {
                    bar.Dispose();
                });
                invokeCircularProgressBar();
            }
            catch
            {
                invokeCircularProgressBar();
            }
        }
Exemplo n.º 2
0
        private void ponto(object sender, EventArgs e)
        {
            ProgressBarMeu a = sender as ProgressBarMeu;

            Invoke((Action) delegate
            {
                if (a.Value >= 93 && a.Value <= 100)
                {
                    Pontos.Text = (30 + Convert.ToInt32(Pontos.Text)) + "";
                }
                else
                {
                    Pontos.Text = (3 + Convert.ToInt32(Pontos.Text)) + "";
                }
                a.Value = a.Maximum;
                a.Dispose();
            });
        }