472,799 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 software developers and data experts.

beginner question about a progress bar

Hi.

hi have a custom created smooth progress bar (Pbar)
control and i wanted to know how i can reset the bar to 0
after the bar has run to completion.

The pbar uses a timer control to function
The code that i have been given in an example is:

'this is added to the tick event for the timer
If (Me.SmoothProgressBar1.Value > 0) Then
Me.SmoothProgressBar1.Value -= 1
Me.SmoothProgressBar2.Value += 1
Else
Me.Timer1.Enabled = False
End If

'this is added to the onclick event on a button:
Me.SmoothProgressBar1.Value = 100
Me.SmoothProgressBar2.Value = 0

Me.Timer1.Interval = 1
Me.Timer1.Enabled = True

at present this code runs 2 progress bars on the form.
one runs backwards, while the other goes forward.
I need help on modifying this to just use one pbar that
goes forward and then resets itself once it has completed.

Can anyone help me.
thx for your help

Nov 20 '05 #1
6 6368
* "Samantha" <an*******@discussions.microsoft.com> scripsit:
hi have a custom created smooth progress bar (Pbar)
control and i wanted to know how i can reset the bar to 0
after the bar has run to completion.

The pbar uses a timer control to function
The code that i have been given in an example is:
See inline comments.

\\\
'this is added to the tick event for the timer
If Me.SmoothProgressBar1.Value = 100 Then
Me.SmoothProgressBar1.Value = 0
Me.Timer1.Enabled = False
Else
Me.SmoothProgressBar1.Value += 1
End If
///
at present this code runs 2 progress bars on the form.
one runs backwards, while the other goes forward.
I need help on modifying this to just use one pbar that
goes forward and then resets itself once it has completed.


--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"Samantha" <an*******@discussions.microsoft.com> wrote...
The pbar uses a timer control to function
The code that i have been given in an example is:


Samantha... I hate to throw a monkey wrench into this but consider that your
progress bar isn't really marking "progress" but rather the passage of time.

You could set up an endless loop and your timer interrupt would smoothly
move the bar but nothing is really being done. Resetting it to zero will
make it start over but it will never be finished. Progress indicators
should have a direct tie to whatever it is monitoring. If it was
downloading a file (for instance) 100% would be the total file size and it
could update each time 1% more data showed up. Similarly if it was
processing a database table the total number of rows to process would be
displayed and it could "tick" each time a row was processed.

Tom
Nov 20 '05 #3
Hi Herfried,

I used the code u gave me and it works great. The only
problem i have encountered now is that this code for the
onclick event that runs the progress bar does not run
before the new form is loaded. What should i write for
the onclick event that would change this?? once the new
form has opened i want the old form to close.

currently i have the following under the onclick event:

Me.Timer1.Interval = 1
Me.Timer1.Enabled = True
Dim frmRes As New frmRes()
frmRes.Show()

what could i change to make it work?
once again, thank u so much for your help. :o)
-----Original Message-----
* "Samantha" <an*******@discussions.microsoft.com> scripsit:
hi have a custom created smooth progress bar (Pbar)
control and i wanted to know how i can reset the bar to 0 after the bar has run to completion.

The pbar uses a timer control to function
The code that i have been given in an example is:


See inline comments.

\\\
'this is added to the tick event for the timer
If Me.SmoothProgressBar1.Value = 100 Then
Me.SmoothProgressBar1.Value = 0
Me.Timer1.Enabled = False
Else
Me.SmoothProgressBar1.Value += 1
End If
///
at present this code runs 2 progress bars on the form.
one runs backwards, while the other goes forward.
I need help on modifying this to just use one pbar that goes forward and then resets itself once it has

completed.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #4
* "Samantha" <an*******@discussions.microsoft.com> scripsit:
I used the code u gave me and it works great. The only
problem i have encountered now is that this code for the
onclick event that runs the progress bar does not run
before the new form is loaded. What should i write for
the onclick event that would change this?? once the new
form has opened i want the old form to close.

currently i have the following under the onclick event:

Me.Timer1.Interval = 1
Me.Timer1.Enabled = True
Dim frmRes As New frmRes()
frmRes.Show()


I don't understand why you use the progressbar + timer. Which progress
should it visualize?

If you want to unload/load forms, one after the other, have a look here:

<http://groups.google.com/groups?selm=u%23xQOutWDHA.2100%40TK2MSFTNGP11.phx. gbl>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Hi,

i am not trying to visulise any progress. I am building a
prototype so i just need it to look as if it is
monitoring progress. I do not know the first thing about
programming and am just starting to learn. This is the
first language i have tried so am struggling big
time!! :o)
As this is a custom built control, i cant find any
resources on how i can manipulate it so i applogise for
the many questions that i have asked. This is why i am
using the timer, as this is the only resource i have
found telling me how to make it work.

Any help would be great.
thank u for your time and patience :o)

-----Original Message-----
* "Samantha" <an*******@discussions.microsoft.com> scripsit:
I used the code u gave me and it works great. The only
problem i have encountered now is that this code for the onclick event that runs the progress bar does not run
before the new form is loaded. What should i write for
the onclick event that would change this?? once the new form has opened i want the old form to close.

currently i have the following under the onclick event:

Me.Timer1.Interval = 1
Me.Timer1.Enabled = True
Dim frmRes As New frmRes()
frmRes.Show()


I don't understand why you use the progressbar + timer.

Which progressshould it visualize?

If you want to unload/load forms, one after the other, have a look here:
<http://groups.google.com/groups?selm...QOutWDHA.2100% 40TK2MSFTNGP11.phx.gbl>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #6
* "Samantha" <an*******@discussions.microsoft.com> scripsit:
i am not trying to visulise any progress. I am building a
prototype so i just need it to look as if it is
monitoring progress. I do not know the first thing about
programming and am just starting to learn. This is the
first language i have tried so am struggling big
time!! :o)
I remember the time when I was struggling with programming languages
too.

;-)
As this is a custom built control, i cant find any
resources on how i can manipulate it so i applogise for
the many questions that i have asked. This is why i am
using the timer, as this is the only resource i have
found telling me how to make it work.


If you have any questions, feel free to post them to this or an other
appropriate group.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eva | last post by:
hi, I have just managed to add a progress bar to my statusbar control. the problem i am having is that t appears in the far left as default. I want it to appear in the far right side of the...
6
by: Alex | last post by:
Hello I am intersting in developing and my background is VBA used in Excel and a brief intro to Java. I am interested in learning beyond VB and feel that C++ would be a very good language to...
2
by: Nikolay Petrov | last post by:
In many examples about progress bars i've seen that a loop is used to change the progress bar value. What if I want to show a progress bar for an operation that does not have loops? Like...
1
by: GS | last post by:
Hi, I'm using buffering to write to client about progress of long running query, my question is how do I remove everything from browser screen what was written so far once results are ready....
5
by: Aggelos | last post by:
Hello I am doing sevreral scripts like sending a newsletter that might take a while to finish first to prevent the browser from timing out and to keep the user informed of the process progress I...
12
by: kimiraikkonen | last post by:
Hi there, There is a problem about progress bar; although the "progressbar1.visible = True" is present for my invisible "progressbar1" control to make visible when button1 is clicked, before...
6
by: kimiraikkonen | last post by:
Hi, I use system.io.file class to copy files but i have a difficulty about implementing a basic / XP-like progress bar indicator during copying process. My code is this with no progress bar,...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
8
by: iPaul | last post by:
hi this is my code #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <stdlib.h> #include <string.h> #include <iostream>
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.