Solved

Working indicators not animating

Posted on 2009-07-08
5
573 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now