473,804 Members | 3,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SmoothProgr essBar1.Value > 0) Then
Me.SmoothProgre ssBar1.Value -= 1
Me.SmoothProgre ssBar2.Value += 1
Else
Me.Timer1.Enabl ed = False
End If

'this is added to the onclick event on a button:
Me.SmoothProgre ssBar1.Value = 100
Me.SmoothProgre ssBar2.Value = 0

Me.Timer1.Inter val = 1
Me.Timer1.Enabl ed = 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 6423
* "Samantha" <an*******@disc ussions.microso ft.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.SmoothProgre ssBar1.Value = 100 Then
Me.SmoothProgre ssBar1.Value = 0
Me.Timer1.Enabl ed = False
Else
Me.SmoothProgre ssBar1.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*******@disc ussions.microso ft.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.Inter val = 1
Me.Timer1.Enabl ed = 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*******@disc ussions.microso ft.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.SmoothProgre ssBar1.Value = 100 Then
Me.SmoothProgre ssBar1.Value = 0
Me.Timer1.Enabl ed = False
Else
Me.SmoothProgre ssBar1.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*******@disc ussions.microso ft.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.Inter val = 1
Me.Timer1.Enabl ed = 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.c om/groups?selm=u%2 3xQOutWDHA.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*******@disc ussions.microso ft.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.Inter val = 1
Me.Timer1.Enabl ed = 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*******@disc ussions.microso ft.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
1296
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 form. Can anyone help me code this or point me to a good article?? this is my code so far.. Dim Pbar As New ProgressBar()
6
1573
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 get to know and give a lot of flexibility (if not tough to learn). I would like some advice on the merits of learning C++ versus C# or Visual Basic or Java for that matter.
2
1077
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 writing big file to disk. How to do that? Also how to show the progress of a thread, which also don't have loops?
1
1227
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. Right now Response.Write writes to output stream even before <HTML> tag is written so I can not really use <DIV> elements etc. Any ideas short of doing AJAX stuff? Or ASP.NET 2.0 gives me some miracle controls which will do that for me? Greg
5
4046
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 want to use a loader progress bar. I did a plain expanding gif but the problem is that it prevents me at the end from redirecting. Do you have in mind any nice script that might do that? AJAX would be a good solution. Or something that will pop...
12
3113
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 execution of my external process, it appears after the external process finishes processing. And my main and only form (form1) cannot be interacted while external process is processing. How can i get rid of it? Here is the code:
6
4999
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, or i couldn't find sth which give totalbytes/written bytes class. And does system.io.file class provide awaring of the chunks / bytes of the files bytes which are written?
22
18154
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 programmer and looking for a starting point in regards to practical projects to work on. What are some projects that beginner programmers usually start with? Please list a few that would be good for a beginner PHP programmer to
8
1908
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>
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.