Solved

URGENT C# Form Load takes awhile. Show a progress bar while loading

Posted on 2007-11-27
6
5,852 Views
Last Modified: 2012-05-05
I have a form that takes awhile to load becasue it has to unzip a folder parse a file and load that file onto the screen.

The problem is that the screen takes a while to load. Basically giving the user the impression that the screen froze.

So what I was thinking is showing a progress bar that says form loading. How do I go about doing this.
0
Comment
Question by:NewMom2Brandon
  • 2
  • 2
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20361365
inside your parsing function, you can call Application.DoEvents() to avoid freezing
0
 
LVL 2

Author Comment

by:NewMom2Brandon
ID: 20361723
I tried that and it actually did freeze my application.

Its not that the application is freezzing its just that it take a while for the form to load
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20361744
So, just include the progress bar into your form and update it from the parsing function, you have to call DoEvents anyway to allow the progress bar to show advance.
0
 
LVL 2

Accepted Solution

by:
NewMom2Brandon earned 0 total points
ID: 20366624
The best solution was to actually place a backgroundWorker into my form I am loading.
I also added a Status bar, and timer. This allowed my form to load and show the user that something is happening.

http://www.c-sharpcorner.com/UploadFile/LivMic/BGWorker07032007000515AM/BGWorker.aspx
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20391015
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
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

Suggested Solutions

Title # Comments Views Activity
ASP.NET Web API or ASP.NET Core MVC? 3 52
Excel file not created as expected 7 50
Two different visual studio versions 3 23
Connection String 16 43
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

16 Experts available now in Live!

Get 1:1 Help Now