Solved

Status bar

Posted on 2001-09-15
4
236 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
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 50 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

821 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