Progress Bar Control

Please I want to know how to work with VB 6.0 prograss bar specificall

Page 1 of 1

3 Replies - 13202 Views - Last Post: 26 August 2008 - 09:18 AM Rate Topic: -----

#1 tunsten  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 29-May 08

Progress Bar Control

Post icon  Posted 13 July 2008 - 02:17 AM

Please I want to know how to work with VB 6.0 prograss bar specifically, how to add code to it at run time to estaimate progression of an operation
Is This A Good Question/Topic? 0
  • +

Replies To: Progress Bar Control

#2 Zhalix  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 260
  • Joined: 07-May 08

Re: Progress Bar Control

Posted 13 July 2008 - 04:34 AM

Keep the minimum value at 0.
Set the max value

To move along the progress, you'll have to add to the value, like this:

ProgressBar1.Value = ProgressBar1.Value + 1



That's as much as I can tell you, because:

1) I don't know exactly what you need help with.
2) You haven't shown any effort. :)

If you post again clearly stating your problem, what you hope to accomplish, and provide us with the code you have written that isn't working, then you will receive more help. ;)

This post has been edited by Zhalix: 13 July 2008 - 04:53 AM

Was This Post Helpful? 0
  • +
  • -

#3 Saptarshi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 10-August 08

Re: Progress Bar Control

Posted 10 August 2008 - 08:53 PM

AS YOU WANT TO SHOW THE PROGRESSION OF AN OPERATION SO YOU WILL HAVE TO ARRANGE THE CODE YOURSELF I AM JUST POSTING THAT HOW TO USE A PROGRESS BAR
YOU CAN SET A PROGRESS BAR FOR OPERATIONS LIKE WHEN X > 2 THEN
TIMER1 WILL BE ENABLED AND THUS THE PROGRESS BAR WILL MOVE FROM 0 TO 100 AND WHEN IT REACHES 100 % THEN A DESIRED TASK WILL BE PERFORMED LIKE A FORM WILL BE LOADED OR UNLOADED IN THIS WAY YOU CAN USE THE PROGRESS BAR.

IF YOU WANT TO USE THE BUILT-IN PROGRESS BAR OF VB6 FOR VIEWING THE PROGRESS REPORT THROUGH THE PROGRESS BAR THEN YOU CAN USE THE FOLLOWING CODE:
I AM POSTING A CODE ASSUMING THAT WHEN THE PROGRESS BAR WILL SHOW 100% THEN
A FORM WILL BE LOADED ,YOU CAN MODIFY THE EVENT ACCORDING TO YOUR NEED.
EXAMPLE I WANT TO LOAD A FORM WHEN THE PROGRESSBAR SHOWS 100% YOU MAY UNLOAD
A FORM WHEN THE PROGRESS BAR SHOWS 100%

STEP
1. CREATE TWO STANDARD EXE NAME ONE AS Form1 AND THE Other AS Form2
2.PUT A TIMER AND A PROGRESS BAR IN Form1 AND SET THE TIMER INTERVAL AS 200 AND SET THE MINIMUM VALUE OF THE PROGRESS BAR AS 1 AND THE MAXIMUM VALUE AS 100.
3.UNDER TIMER1 EVENT PUT THE CODE BELOW
4.SAVE AND RUN U WILL SEE THAT WHEN THE FORM1 LOADS THEN THE PROGRESS BAR SHOWS 100% THEN Form2 GETS LOADED

CODE

Private Sub Timer1_Timer()
If ProgressBar1.Value <> ProgressBar1.Max Then
ProgressBar1.Value = (ProgressBar1.Value + 1)
Else
Unload Me
Form2.Show
End If
End Sub

CODE

This post has been edited by Saptarshi: 10 August 2008 - 09:03 PM

Was This Post Helpful? 0
  • +
  • -

#4 tunsten  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 29-May 08

Re: Progress Bar Control

Posted 26 August 2008 - 09:18 AM

Thanks so much,

I have already tried many possiblilities and I have goten it right.

View PostSaptarshi, on 10 Aug, 2008 - 08:53 PM, said:

AS YOU WANT TO SHOW THE PROGRESSION OF AN OPERATION SO YOU WILL HAVE TO ARRANGE THE CODE YOURSELF I AM JUST POSTING THAT HOW TO USE A PROGRESS BAR
YOU CAN SET A PROGRESS BAR FOR OPERATIONS LIKE WHEN X > 2 THEN
TIMER1 WILL BE ENABLED AND THUS THE PROGRESS BAR WILL MOVE FROM 0 TO 100 AND WHEN IT REACHES 100 % THEN A DESIRED TASK WILL BE PERFORMED LIKE A FORM WILL BE LOADED OR UNLOADED IN THIS WAY YOU CAN USE THE PROGRESS BAR.

IF YOU WANT TO USE THE BUILT-IN PROGRESS BAR OF VB6 FOR VIEWING THE PROGRESS REPORT THROUGH THE PROGRESS BAR THEN YOU CAN USE THE FOLLOWING CODE:
I AM POSTING A CODE ASSUMING THAT WHEN THE PROGRESS BAR WILL SHOW 100% THEN
A FORM WILL BE LOADED ,YOU CAN MODIFY THE EVENT ACCORDING TO YOUR NEED.
EXAMPLE I WANT TO LOAD A FORM WHEN THE PROGRESSBAR SHOWS 100% YOU MAY UNLOAD
A FORM WHEN THE PROGRESS BAR SHOWS 100%

STEP
1. CREATE TWO STANDARD EXE NAME ONE AS Form1 AND THE Other AS Form2
2.PUT A TIMER AND A PROGRESS BAR IN Form1 AND SET THE TIMER INTERVAL AS 200 AND SET THE MINIMUM VALUE OF THE PROGRESS BAR AS 1 AND THE MAXIMUM VALUE AS 100.
3.UNDER TIMER1 EVENT PUT THE CODE BELOW
4.SAVE AND RUN U WILL SEE THAT WHEN THE FORM1 LOADS THEN THE PROGRESS BAR SHOWS 100% THEN Form2 GETS LOADED

CODE

Private Sub Timer1_Timer()
If ProgressBar1.Value <> ProgressBar1.Max Then
ProgressBar1.Value = (ProgressBar1.Value + 1)
Else
Unload Me
Form2.Show
End If
End Sub

CODE

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1