Solved

VB.Net Form take time to load.

Posted on 2012-04-08
3
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now