?
Solved

Progress Bar

Posted on 2003-03-22
9
Medium Priority
?
325 Views
Last Modified: 2010-05-01
I have a small problem. When I'm opening a file I have a progress bar that indicates how everything is going. If I click anywhere on my app during this open, it will keep opening but the progress bar won't show anything! Can someone help?
0
Comment
Question by:igfp
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 1

Expert Comment

by:Piter
ID: 8185904

When you click somewhere else i.e. in your application Progress bar hides back side ie on Desktop. You just minimize all your application and check.and increase interval of Progress bar.
 When you click on Your application while progress bar running.. just click "CTRL + M"... you will get progress bar running on desktop.

hope it works.
0
 

Author Comment

by:igfp
ID: 8185942
no that's not it. When i click anyplace on my app it stops the progress bar, but still does everything! Windows says app is not responding but it is! It actually stays fine just after the opening time but with no visual indicators that that is happening.
0
 
LVL 1

Expert Comment

by:Piter
ID: 8185959

Can u paste you code of progress bar..

 
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:igfp
ID: 8185976
   Me.MousePointer = 11
    LoadingBar.Visible = True
    Open CommonDialog.FileName For Input As #1
    Input #1, AllText
    Close #1

    nChars = Len(AllText)
    Decrypt = Space(nChars)
    ReDim chars(nChars)
    LoadingBar.Max = nChars
    LoadingBar.Value = 0

    For i = 1 To nChars
       letter = Mid(AllText, i, 1)
       'decrypt code
       LoadingBar.Value = LoadingBar.Value + 1
    Next i

    loadingbar.visible = false
    Me.MousePointer = 0
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 80 total points
ID: 8186271
try adding a DoEvents to your code:

Me.MousePointer = 11
   LoadingBar.Visible = True
   Open CommonDialog.FileName For Input As #1
   Input #1, AllText
   Close #1

   nChars = Len(AllText)
   Decrypt = Space(nChars)
   ReDim chars(nChars)
   LoadingBar.Max = nChars
   LoadingBar.Value = 0

   For i = 1 To nChars
      letter = Mid(AllText, i, 1)
      'decrypt code
      LoadingBar.Value = LoadingBar.Value + 1
   DoEvents
   Next i

   loadingbar.visible = false
   Me.MousePointer = 0
0
 

Author Comment

by:igfp
ID: 8186699
doevents does what?
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8186727
It allows Windows to breath while your application is running in a loop.

Actually it lets windows process messages in it's queue which will allow your progress bar to update while you are your For/Next loop.
0
 

Author Comment

by:igfp
ID: 8187825
it works fine but can i ask how do we avoid an app to unload when it's executing a task? I want it to be impossible for the user to exit while he is saving or opening. thank you!
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8188137
use the QueryUnload event:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Label1.Caption = "Processing" Then
    Cancel = 1
End If
End Sub

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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 Month10 days, 8 hours left to enroll

765 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