C# Circular ProgressBar Update and Timer

July 11, 2017 Oclemy C# ProgressBar, C# Timer 0 minutes, 56 seconds

Hey here we look at Circular progressbar from italk theme.Please this is a third party library/theme we are using.They have a pretty nice circular/radial progressbar that we are using.Am attaching full source code so that you can run in your visual studio.

The theme is a single C# file that you simply copy into your project and rebuild and it adds various components in your toolbar in visual studio.Its easy,no setup or configurations. Note we are using the progresbar in a similar way we use the ordinary winforms progresbar.  

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Circular_Progress
{
    public partial class Form1 : Form
    {
        int progress = 0;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            //INCREMENT OUR PROGRESS VALUE
            progress += 1;
            if(progress >=100)
            {
                timer1.Enabled = false;
                timer1.Stop();
            }

            //OTHERWISE
            progressBar1.Value = progress;
            pb.Value = progress;
        }

        private void startBtn_Click(object sender, EventArgs e)
        {
            progress = 0;
            timer1.Enabled = true;
            timer1.Interval = 50;
        }

    }
}

Cheers.

Comments