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
Solved

Working indicators not animating

Posted on 2009-07-08
5
591 Views
Last Modified: 2012-05-07
Hi experts!
I have an issue with working indicators, using: (Either)
RadWaitingBar, SpinningProgress (Excellent), an animated gif, or even a simple seconds counter. (Label)
Any of these elements are to be shown on a tiny borderless form as a visual clue of the application running.
The problem I have is that none of them (Using one at a time, of course) animates when the form is shown, they appear static, not moving as they are intended to.
The time for the process to complete varies according to the user input.
Please help.
Thanks in advance.
This is the method I'm using.

Private Sub cmdMake_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMake.Click
        Try
            fm.Show()   'class-level form previously declared which contains the indicator.
            Application.DoEvents()
                    'Does what the app does.
            Catch ex As Exception
        Finally
            fm.Close()
        End Try
    End Sub

Open in new window

0
Comment
Question by:jorgemgonzalez
5 Comments
 
LVL 13

Expert Comment

by:kaylanreilor
ID: 24811378
Perhaps you should call the Activate() method first. But also I'm not sure to understand what is the type of fm : shouldn't you use a PictureBox for example to host the animated gif ?
0
 
LVL 5

Assisted Solution

by:Pablissimo
Pablissimo earned 150 total points
ID: 24812733
Does your long process contain regular calls to Application.DoEvents?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 350 total points
ID: 24815044
I think Pablissimo is on the right track.  Your "working indicators" are not animating because the UI thread is "stuck" in your heavy processing loop.

Either:

(1) Place a call to Application.DoEvents() INSIDE your processing loops.
(2) Utilize manually created threads and use delegate/invokes to update the form when necessary.
(2) Use the built-in BackgroundWorker() component and the Progess and/or Completed events.
0
 

Author Closing Comment

by:jorgemgonzalez
ID: 31601439
Thank you for pointing me to the right direction.
0
 

Author Comment

by:jorgemgonzalez
ID: 24816832
Thank you experts for the fast reply. That did it, problem solved!!! ;-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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