Jump to content




Recent Status Updates

  • Photo
      18 Aug
    KodeKool

    When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."

    Show comments (2)
View All Updates

Developed by Kemal Taskin
Photo
- - - - -

ProgressBar in VB6

Visual Basic 4 / 5 / 6 timer

  • Please log in to reply
12 replies to this topic

#1 MathX

MathX

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,034 posts
  • Programming Language:Java
  • Learning:C, Java, C++, PHP, JavaScript, PL/SQL

Posted 12 January 2009 - 01:30 AM

Hi all!

Today I am going to make another simple tutorial about how to make a progress bar in VB6.

First you must include some components. Go to Project – Components – (in the list choose) Microsoft Windows Common Controls 5.0.

You will see this now:

Posted Image



Now double click on form1 and drag-and-drop a PrograssBar, a timer and a Button.


It will look something like this:

Posted Image



On form_load (simply double click on the form and you will be ready to write the code) wrote this line on code.

Private Sub Form_Load()
ProgressBar1.Value = ProgressBar1.Min
End Sub

It sets the value of the ProgressBar at min.

First set the interval of the timer:

Posted Image


Now double click on the timer and write this:

Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 10
If ProgressBar1.Value = 50 Then
ProgressBar1.Value = ProgressBar1 + 50
If ProgressBar1.Value >= ProgressBar1.Max Then
Timer1.Enabled = False
End If
End If
End Sub

You probably understand this code. I wanted to make the progressbar faster from the middle of it.

Double click on the button (its name has been changed into “close”) and write:

Private Sub Command1_Click()
End
End Sub

It will close the program.

By MathX

Enjoy…
  • 6

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#2 Guest_Jordan_*

Guest_Jordan_*
  • Guest

Posted 12 January 2009 - 05:50 AM

Very neat. This can be used to create a "splash" screen.
  • 0

#3 Egz0N

Egz0N

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,155 posts

Posted 12 January 2009 - 07:50 AM

nice tutorial dude :)
  • 0

#4 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 12 January 2009 - 08:05 AM

Nice tutorial . +rep .
  • 0

#5 MathX

MathX

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,034 posts
  • Programming Language:Java
  • Learning:C, Java, C++, PHP, JavaScript, PL/SQL

Posted 13 January 2009 - 12:29 AM

Thank u all!!!
  • 0

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#6 Turk4n

Turk4n

    ???

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,919 posts
  • Location:Sweden
  • Programming Language:C, Java, PHP, Python, Bash
  • Learning:C++, C#, JavaScript, Visual Basic .NET, Others

Posted 13 January 2009 - 06:55 AM

This is something I must try :D


EDIT - Love you, enjoy rep+ :)

Edited by Turk4n, 13 January 2009 - 09:52 AM.

  • 0

#7 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 17,006 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 14 January 2009 - 08:23 AM

Nice. I'd +rep you, but I can't.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#8 amrosama

amrosama

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 2,764 posts

Posted 14 January 2009 - 11:24 AM

nice elban
rep to my riend
  • 0
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#9 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 14 January 2009 - 11:55 AM

i can +rep u now .. i think this +rep is gonna make you a GURU ..
Best wishes my friend .. :)
  • 0

#10 Datasoft

Datasoft

    CC Lurker

  • Validating
  • Pip
  • 1 posts

Posted 25 February 2009 - 07:23 AM

Hi
Can anyone help me, how to get the Progressbar follow a movieclip, so the Progressbar ends the same time as the movie?
Thank you.
  • 0

#11 Brandon W

Brandon W

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 2,092 posts
  • Location:Ipswich, Australia
  • Programming Language:C, Java
  • Learning:Java, C++, JavaScript

Posted 27 February 2009 - 04:34 AM

Mate, if you wish to get help, I would suggest you post in a new thread. Many more people will see your question and it will be answered in under 1 day :)
  • 0
I've returned...

#12 giv3mesmile

giv3mesmile

    CC Newcomer

  • Just Joined
  • PipPip
  • 14 posts

Posted 22 January 2010 - 08:00 AM

Nice! :) good job ^_^
  • 0





Also tagged with one or more of these keywords: Visual Basic 4 / 5 / 6, timer