Solved

Working indicators not animating

Posted on 2009-07-08
5
561 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
Comment Utility
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
Comment Utility
Does your long process contain regular calls to Application.DoEvents?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 350 total points
Comment Utility
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
Comment Utility
Thank you for pointing me to the right direction.
0
 

Author Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

14 Experts available now in Live!

Get 1:1 Help Now