[ProgressBar movement] !
Posted: Mon Apr 09, 2012 12:08 am
Okay,
I got bored, Just making a test application with VS2011 BETA.
This will increase based on mathematical calculations, I will actually make this fully random so no increase is the same, However I got bored, and thought I would share
Code:
I got bored, Just making a test application with VS2011 BETA.
This will increase based on mathematical calculations, I will actually make this fully random so no increase is the same, However I got bored, and thought I would share
Code:
Code: Select all
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int valInc = 0;
private void timer1_Tick(object sender, EventArgs e)
{
valInc = valInc * 2 + 1;
int val = progressBar1.Value * valInc / 5 + 3;
if (val > 100)
progressBar1.Value = 100;
else
progressBar1.Value = val;
timer1.Interval = timer1.Interval / 2;
if (timer1.Interval <= 1000)
timer1.Interval = 2000;
if (progressBar1.Value > 20)
{
timer1.Interval = 3000;
}
if (progressBar1.Value >= 100)
timer1.Stop();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 3000;
timer1.Enabled = true;
timer1.Start();
}
}
}