Question Form Not responding

aditya_raj

Member
Joined
Dec 17, 2007
Messages
5
Programming Experience
1-3
HI,

I wrote windows app to upload files to different FTP sites by picking the files from different folders.A log is displayed by appending text to the textbox at every step.Textbox is ReadOnly.

Issue:When app is loading a bf file to FTP and if user tries to scroll the textbox,the form is hanging and going to Not Responding.

Is there a way i can avoid this?
 
Each thread can only do one thing at a time. If your UI thread is busy uploading a file to an FTP site then it cannot respond to user interaction and therefore cannot update the UI. It's for this reason that anything that takes any significant time should not be done on the UI thread. You need to either use the asynchronous method(s) of the type you're using if available or else use the same synchronous methods on a secondary thread.
 
Do research for BackgroundWorker component, it is easy and good to use in winforms applications.
 
Back
Top