Solved

Working indicators not animating

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataGridView Events ? 3 45
Pagebreak issue while printing the aspx page 3 24
.NET 2008 VB and C# 6 27
Sql server, import complete table, using vb.net 9 33
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

806 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