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 / April 2005

Tip: Looking for answers? Try searching our database.

Refreshing Form on Process

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
11Oppidan - 30 Mar 2005 18:58 GMT
Hello,

I have a windows application written in VB .NET which pulls a lot of data
from different databases into one source.  This often takes a long time and
therefore I track the progress using a progress bar and a status bar.

When the program is running and I use another application the form turns
white and doesn't refresh itself until the process is complete. Could anyone
advice me/provide a VB example of the best way to keep a windows form
refreshed when running, but still restrict the user from setting off another
process?

Many thanks for your advice.
gyurisc - 30 Mar 2005 19:08 GMT
You should probably use a new thread to complete the operation. There is a
component called backgroundworker what is a component  in whidbey and can be
used for this purpose.

If you do not want to do multithreading then you should try to call the
Application.DoEvents() method while you are waiting for the data to arrive.

Cris

> Hello,
>
[quoted text clipped - 9 lines]
>
> Many thanks for your advice.
11Oppidan - 30 Mar 2005 20:04 GMT
Application.DoEvents works great but lets the user have of the cursor back
from my WaitCursor, enabling them to restart the process.  How do I lock up
the form when using Application.DoEvents whilst it's running.

Many thanks for your assistance - it's much appreciated.

> You should probably use a new thread to complete the operation. There is a
> component called backgroundworker what is a component  in whidbey and can
[quoted text clipped - 19 lines]
>>
>> Many thanks for your advice.
Jason Newell - 30 Mar 2005 22:11 GMT
11Oppidan,
    I haven't tried it but what about "this.Enabled = false" where "this"
refers to your main form.  Then "this.Enabled = true" when you're done.

Jason Newell, MCAD
Software Engineer

> Application.DoEvents works great but lets the user have of the cursor back
> from my WaitCursor, enabling them to restart the process.  How do I lock up
[quoted text clipped - 25 lines]
>>>
>>>Many thanks for your advice.
"Jeffrey Tan[MSFT]" - 31 Mar 2005 02:22 GMT
Hi 11Oppidan,

Based on my understanding, your current concern is how to prevent the user
from re-starting the background processing(database querying) when the
processing is going. If I misunderstand you, please feel free to tell me.
Thanks

I think Jason has provided you a way to disable the entire form(Just set
Form.Enabled=false), which will diable any user interaction function of the
form. But normally, I think it is better for the user can still get the UI
interaction, we may just disable the button's function that may re-start
the background processing(Just use this.button1.Enabled=false).

Additionally, I think using multithreading will give application user a
better interactive experience, which is easy to implement in .Net. You may
refer to the Chris Sells' article for a good idea, it uses a demo
application, which calculate the accurate value of PI in background thread,
and in UI thread, it uses a prograssbar to display the processing prograss:
"Safe, Simple Multithreading in Windows Forms, Part 1"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/htm
l/winforms06112002.asp

Hope this helps
========================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

"Jeffrey Tan[MSFT]" - 04 Apr 2005 03:04 GMT
Hi 11Oppidan,

Does my reply make sense to you? Do you still have any concern on this
issue? Please feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


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.