Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

Progress Bar

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
igfp
Asked:
igfp
  • 4
  • 3
  • 2
1 Solution
 
PiterCommented:

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
 
igfpAuthor Commented:
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
 
PiterCommented:

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.

 
igfpAuthor Commented:
   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
 
vinnyd79Commented:
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
 
igfpAuthor Commented:
doevents does what?
0
 
vinnyd79Commented:
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
 
igfpAuthor Commented:
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
 
vinnyd79Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now