Post by Cryotica on Apr 23, 2014 1:55:03 GMT 10
When using a big project that lags a lot when loading a new form, try to use some kind of distraction, it makes you look more professional and a guy who knows what he is doing!
If you live in the future, why worry about the present? It's the past . . .
Proud Supporter of Nathan Lecompte!
|
|
Post by Makan on May 11, 2014 10:01:47 GMT 10
But when the project is loading it freezes and you just see the spinning ball on your pointer. How do you make it so that when it is loading it will show something else?
|
|
Post by altair on Feb 11, 2015 22:29:51 GMT 10
But when the project is loading it freezes and you just see the spinning ball on your pointer. How do you make it so that when it is loading it will show something else? I guess it is possible by asynchronous functions. For example, if you are using WebClient to download a file from a string which we normally do by Issuing SomeWebClientObject.DownloadString(SomeURLString) but instead of that you can create a handler and use SomeWebClientObject.DownloadStringAsync(SomeURLString) but this time it will allow your code to continue running as if it skipped. Although setting up a asynchronous function is a tough. It will allow us to do whatever we want when the code is being executed in background and then get a broadcast(like a message from the system, this should sound familiar if you have worked in programming for ios, android etc.) when the asynchronous process is complete you can execute whatever code you want you have put in the Sub with the handler. I am not sure it will work with all functions. Because Async's are mostly used in Windows Phone programming. Put it together with Cryotica's idea. You can create and execute the code you want on the Form_Load. While which you can do the distractions stuff. Then when the asynchronous function is complete it will send the broadcast with which you can stop distracting and get into real business. Altair - The Flying One
|
|
Post by oniii on Mar 28, 2015 22:22:12 GMT 10
Or you can Multi-Thread
|
|
Post by altair on Mar 30, 2015 6:22:39 GMT 10
Yes, That will also work Altair - The Flying One
|
|
Post by dar on Mar 30, 2015 8:08:40 GMT 10
Or. Use "suspendlayout" "resumelayout" Or. Use application.doevents - which basically redraws ur controls to prevent windows from checking the messagelist (the size of message list determines whether the application is hanging)
Personally, I use multi threading and application doevents
|
|
Post by altair on Mar 30, 2015 21:22:30 GMT 10
Well, they are personal preferences
Altair - The Flying One
|
|