470,855 Members | 1,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

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 1757
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.com>
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.com>
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 BackgroundWorker 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.com>
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Robert Smith | last post: by
8 posts views Thread by WhiteWizard | last post: by
1 post views Thread by daniel_xi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.