473,549 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WinForm Progress Update

WB
Hi,

I'm building my first Windows application using C#.

My Windows application sends newsletter to our subscribers by email. Our
newsletter is sort of "customized " so my application has to build the
newsletter for each individual subscriber before sending it out. Now the
whole newsletter sending process to all the subscribers is a very long
process and I'd like to keep my users updated throughout the whole time. I'd
like to accomplish this by having a big text box in my WinForm to display all
the progress messages. In my the various methods of my application I'll keep
updating that text box to display, for example, "Missing email address for
user ABC", "Newsletter has been sent to all New York subscribers" etc etc,
and finally "Task done" after it has finished.

Now the problem is when I run the program, it just goes into a blank and
does it's processing. All the updating messages will only be shown at the end
of the process and that defeats the whole purpose.

What can I do so that my application will keep informing the user of it's
progress?
ywb.
PS. I'll also have a ProgressBar in my WinForm and kind of fill up the bar
to reflect the progress, but I haven't got to that yet.
Apr 9 '06 #1
3 1928
WB <WB@discussions .microsoft.com> wrote:
I'm building my first Windows application using C#.

My Windows application sends newsletter to our subscribers by email. Our
newsletter is sort of "customized " so my application has to build the
newsletter for each individual subscriber before sending it out. Now the
whole newsletter sending process to all the subscribers is a very long
process and I'd like to keep my users updated throughout the whole time. I'd
like to accomplish this by having a big text box in my WinForm to display all
the progress messages. In my the various methods of my application I'll keep
updating that text box to display, for example, "Missing email address for
user ABC", "Newsletter has been sent to all New York subscribers" etc etc,
and finally "Task done" after it has finished.

Now the problem is when I run the program, it just goes into a blank and
does it's processing. All the updating messages will only be shown at the end
of the process and that defeats the whole purpose.

What can I do so that my application will keep informing the user of it's
progress?


You need to use threads.

See http://www.pobox.com/~skeet/csharp/t...winforms.shtml for more
about GUI threading. .NET 2.0 also provides some extra support which
isn't covered there.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 9 '06 #2
WB

Thanks, Jon! I think the link you gave me is exactly the info I need. I just
need some time to digest and understand it...

Where can I find more info on the "extra support" for .Net 2.0 which you
mentioned?
"Jon Skeet [C# MVP]" wrote:
WB <WB@discussions .microsoft.com> wrote:
I'm building my first Windows application using C#.

My Windows application sends newsletter to our subscribers by email. Our
newsletter is sort of "customized " so my application has to build the
newsletter for each individual subscriber before sending it out. Now the
whole newsletter sending process to all the subscribers is a very long
process and I'd like to keep my users updated throughout the whole time. I'd
like to accomplish this by having a big text box in my WinForm to display all
the progress messages. In my the various methods of my application I'll keep
updating that text box to display, for example, "Missing email address for
user ABC", "Newsletter has been sent to all New York subscribers" etc etc,
and finally "Task done" after it has finished.

Now the problem is when I run the program, it just goes into a blank and
does it's processing. All the updating messages will only be shown at the end
of the process and that defeats the whole purpose.

What can I do so that my application will keep informing the user of it's
progress?


You need to use threads.

See http://www.pobox.com/~skeet/csharp/t...winforms.shtml for more
about GUI threading. .NET 2.0 also provides some extra support which
isn't covered there.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Apr 9 '06 #3
WB <WB@discussions .microsoft.com> wrote:
Thanks, Jon! I think the link you gave me is exactly the info I need. I just
need some time to digest and understand it...

Where can I find more info on the "extra support" for .Net 2.0 which you
mentioned?


I'm not sure whether there are any pages which have all the information
together, to be honest. If you look up BackgroundWorke r in MSDN that
will give you some of it. I can't currently remember the name of the
class which helps with displaying progress at the moment, which is
irritating...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 10 '06 #4

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

Similar topics

2
1560
by: Jack Addington | last post by:
I am working on app that currently all resides on the same machine but plan to pull the database off and try to move all the datafunctionality to a remote machine. I have a data function that is processing a loop of rows and calling a stored proc for each row. All is encapsulated within a single oracle transaction. I have a logic class...
2
2941
by: Robert Smith | last post by:
Hello, I have a problem with my progress bar, as shown in the attached code, the values on the bar are incremented within a threaded timer event. The timer works fine and ticks all the way through. However when you Add a new status bar to the form with a Progress bar and then immediately perform some intense programming that uses a lot of...
8
4731
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large binary files, so have created a second thread to do the processing. This thread is set to be the LOWEST priority. So far so good with all that....
1
4104
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET framework 1.1). The application implements a Progress Bar webcontrol, that pops up in a window, using the HttpHandler interface, on the event of a button...
5
10874
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I have a form that has a button. ( this form is a child form of a parent form ( main form ). Anway...in this child form I have a button, and if clicked...
1
3220
by: Bob | last post by:
Hi, I am having trouble seeing how this bolts together. The UI starts a process which involves a long running database update. All Database activity is handled by a class called DT. DT has a progress event. So I added a bw to the form. The Dowork Calls a method which instantiates a DT and calls its Dataprocessing method.
23
42102
ADezii
by: ADezii | last post by:
Many Access Users fail to realize that it has a built-in Progress Meter that can display the relative completion percentage of various processes. It is fairly limited, but nonetheless, does provide visual feedback indicating the percent completion of a certain task. The Meter itself, when activated, rests on the left hand corner of the Status Bar...
2
2176
by: giddy | last post by:
hi , I'm in a slight dilemma. I have an updater program that checks for pending updates and downloads them if the users chooses to. Since i dont need a windows form to check if there is an update , I dont use a form unless i have two. This , creates either one of two problems. When i'm downloading asynchonously , the main thread exits!
6
9910
by: Akhilbh | last post by:
Hi, I have a application which does extensive background processing, I want to show the user a Progress bar till the time processing takes place. I made use of the Progressbar control in VS 2005, i created a new form and placed the control on that and tested it out, it works fine with a timer to it. But, when i incorporated this into my...
0
7527
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
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...
0
7726
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. ...
0
7819
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...
0
3505
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...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1953
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 we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.