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
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.