Solved

VB.Net Form take time to load.

Posted on 2012-04-08
3
209 Views
Last Modified: 2012-04-13
I have form which is attached to menu it takes time 2 min to load,i want reduce this time.How can i do that? i am attached my code file frmdataentry.vb for reference.so pls give me some suggestion for reduce the time.
frmDataEntry.vb
0
Comment
Question by:vpkamble_400
3 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37821564
it looks as if you are doing too much in the form load event.
Just add backgroundworker in your form and let it process your on load tasks in background, this will enable your form to load immediately as it is called..

here is example of bgworker:-
http://www.dotnetperls.com/backgroundworker-vbnet

just one catch here, while the bgworker is processing, you will not be able to update any UI Control as bgworker uses ThreadPool thread to process in
background and you cannot access ui controls in another thread.

So keep that in mind...
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37832859
One quick fix is to use the Shown event instead of Load event so your form appears immediately even though it may be not responding due to the work its doing.
0
 

Author Closing Comment

by:vpkamble_400
ID: 37843753
I GOT MY SOLUATION THANKS DEAR....
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question