Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2005

Tip: Looking for answers? Try searching our database.

Send data to form during intense method.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wade - 19 Aug 2005 16:19 GMT
Hi all,

I have a form in a VB.NET windows application that, when a button is
clicked, runs a pretty intense database process which can take up to ten
minutes to finish.  While it's running, I would like to be able to send data
to the form so that the user knows the the application is still running.

In ASP.NET, I would run this method in a new thread, and then simply update
the form occasionally with data from the application.  Is the approach in a
windows application similar?  And help and/or pointers would be greatly
appreciated.

Thanks,

Wade
Wade - 19 Aug 2005 16:39 GMT
Not sure if this is the best way to do this, but here's what I did ...

1. Created a new thread.  The thread invokes the intense method.
2. I start the thread.  The method called by the thread periodically updates
some status labels on the form.
3. I also created a timer that runs every second.
4. The timer checks to see if the thread is still alive.  If so, it keeps
the controls disabled and prevents the form from being closed.  If it's not,
then I know it's completed and I can wrap things up.

That sound like the right way to do this?

Thanks!

> Hi all,
>
[quoted text clipped - 12 lines]
>
> Wade
SharpCoderMP - 19 Aug 2005 16:50 GMT
> Not sure if this is the best way to do this, but here's what I did ...
>
[quoted text clipped - 5 lines]
> the controls disabled and prevents the form from being closed.  If it's not,
> then I know it's completed and I can wrap things up.
you dont need timer. your form can be enabled or disabled by a thread.
bur i wouldn't do that - it's because it would be nice to allow the user
co cancel this 10minute job. you should at least put a "cancel" button
somwhere that stops your thread and lets the user to take over control.

> That sound like the right way to do this?
>
[quoted text clipped - 16 lines]
>>
>>Wade

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.