473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

timers and progress bar

Hi,

I am creating a project calls a function that has to run for a while. I
would like to display a progress bar on the bottom of that form while that
function is running but everything I've tried doesn't work. It seems like it
just wants to wait for that function to finish before it does anything else.
Any help that I can get would be appreciated.

Thanks
Nov 21 '05 #1
2 1094
BB,

I made this to test it and it is nicely running. Maybe can you try it
yourself.
I have set for this a statusbar on the form and on that a progressbar.

\\\
Private WithEvents tim As New Timer
Private Sub Form5_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
tim.Enabled = True
tim.Interval = 500
Me.ProgressBar1.Value = 1
Me.ProgressBar1.Step = 1
Me.ProgressBar1.Minimum = 1
Me.ProgressBar1.Maximum = 20
End Sub

Private Sub tim_Tick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles tim.Tick
If ProgressBar1.Value <> ProgressBar1.Maximum Then
ProgressBar1.PerformStep()
Else
Me.Close()
End If
End Sub
///

Cor

Nov 21 '05 #2
"bbdobuddy" <bb*******@discussions.microsoft.com> schrieb:
I am creating a project calls a function that has to run for a while. I
would like to display a progress bar on the bottom of that form while that
function is running but everything I've tried doesn't work. It seems like
it
just wants to wait for that function to finish before it does anything
else.
Any help that I can get would be appreciated.


Run the function in a separate thread to prevent blocking the UI thread.

Some information on this topic (there's a link to a C# sample for writing a
multithreaded progress form on the bottom of the page):

Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

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

Similar topics

0
1739
by: Dmitry Demchuk | last post by:
Hi everybody. Recently I ran into situation with System.Threading.Timer in my ASP.NET application. I reinstalled Windows on one of my servers and got timers stop firing events after while, they...
0
1463
by: Joel Cade | last post by:
I'd just like a sanity check on my thinking. I'm attempting to create a progress bar for a file upload to an ASPX page. I'm adding an HTTP Module, which would then call into a "Progress Handler",...
9
7842
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
3
3781
by: Vinay | last post by:
Hello I am trying to update a Progress bar on a form. I am able to update it via using a simple clock timer, but as soon as I perform a long operation G1 (generation of a report) in a separate...
5
9853
by: Michael C# | last post by:
Hi all, I set up a System.Timers.Time in my app. The code basically just updates the screen, but since the processing performed is so CPU-intensive, I wanted to make sure it gets updated...
3
1784
by: bennett.sean | last post by:
Hi, I've tried a number of different things including the use of threads and timers, but can't come up with the solution yet. The issue is this: launch a window with an animation or progress...
1
2996
by: Jonathan Woods | last post by:
Hi there, I have three methods these need to execute at every interval time. I would like to know which option is better? Option A) Three System.Timers.Timer objects these execute each...
4
6897
by: gwoodhouse | last post by:
Hello all, Ive been trying to get a helpful progress bar at the bottom of my app to simply fill up and then disapear. Unfortunatly, i get this error message when i try to change the .Value field...
4
2827
by: Sayanan Sivaraman | last post by:
Hey all, So I've written a simple video player using directshow/COM in VC++, and I'm in the process of translating it to python. For example, when the avi starts playing, I have a call...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7146
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,...
0
7183
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...
0
7356
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...
0
4573
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...
0
3084
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...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
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.