?
Solved

Status bar

Posted on 2001-09-15
4
Medium Priority
?
241 Views
Last Modified: 2010-05-02
Hi,

How to write a pie of code that show the status bar (blue color) in VB like when we downloading the file from internet?

My scenario is every time when user click on the Export Button, the program will extract the data from database (about 4000 records) and then write to excel.

I would like to add the status bar to show the user how many percentage being process....and after finished processing, then pop the message box to tell the user that process is completed. My point is to show the user that the program is processing the data and is not hang!


Can anyone show me some working code?

Thanks.

0
Comment
Question by:ht055
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 200 total points
ID: 6484516
Hi hto55, you could use the progress bar control as supplied by Microsoft is in Microsoft Windows Common controls 6 in the project>components section of VB- depending on what version you have I think.

another option is using this code from MVP Jonathon West to simulate a progress bar in Word

The procedures are as follows, and assume that the progress bar has a Width of 200, and that the lower control is called ProgressBar and the upper one is ProgressBarText.

Private lngPercent As Long

Property Let PercentComplete(Percent As Long)
If Percent < 0 Then
    lngPercent = 0
ElseIf Percent > 100 Then
    lngPercent = 100
Else
    lngPercent = Percent
End If
ProgressBarText.Caption = CStr(lngPercent) & "%"
ProgressBar.Width = 2 * lngPercent
End Property

Property Get PercentComplete() As Long
PercentComplete = lgnPercent
End Property

HTH:O)Bruintje
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6485420
Hearing...
0
 

Author Comment

by:ht055
ID: 6489173
Hi,

Do i have to put the record count? So the status bar will display 100% once is enf of last record?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6496677
bruintje, i just understood your thinking!
Cheers
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 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