Jump to content

Progress Bar 2nd part

- - - - -

  • Please log in to reply
6 replies to this topic

#1
Tonchi

Tonchi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 474 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
in this part i will teach you how to create progressbar control with automatic progress.
in 1st part i showed you how to do it by clicking button every time. this time you will have to click button just one time and your progressbar will fill itself till the end.

remember the code you're using in 1st part!!!

we will take it and use it in this part but we will also use timer object

for what is timer object, please use google...

ok

for this project you'll need to know code from 1st part, code i will give you here and how to put timer object on your form.

1. go to toolbox menu and find Timer object
2. double click on it and it will be a part of your form
3. go inside your timer1 object
4. enter next code:

private void timer1_Tick(object sender, EventArgs e)

        {

            progressBar1.Minimum = 0;

            progressBar1.Maximum = 100;

            progressBar1.Step = 10; //this can be any value from Minimum - Maximum

            progressBar1.PerformStep();

        }

remember!!! that's code from 1st part of this tutorial but now we're using it inside timer object, not button control

5. go inside button control
6. enter next code:

private void button1_Click(object sender, EventArgs e)

        {

            timer1.Enabled = true;

        }


7. go back to your design view and click one time on timer object
8. your homework is to change values of Interval property and figure out what happens

this is a finished project of that simple program and try to compare my project with your

Attached Files



#2
kimtinh2916

kimtinh2916

    Newbie

  • Members
  • Pip
  • 1 posts
i'm needing it. thanks for share....:c-thumbup:

#3
Tonchi

Tonchi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 474 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
no problem...i'm glad i can help someone

#4
Ahmos

Ahmos

    Newbie

  • Members
  • PipPip
  • 12 posts

Posted Image



#5
Tonchi

Tonchi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 474 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
thank you

#6
Diebythejaws

Diebythejaws

    Newbie

  • Members
  • Pip
  • 1 posts
Thanks for the share :thumbup1:

#7
terroare

terroare

    Newbie

  • Members
  • PipPip
  • 16 posts
Thank you for sharing.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users