Solved

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

Posted on 2007-11-27
6
5,851 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

20 Experts available now in Live!

Get 1:1 Help Now