Solved

Progressive icon in vs2005

Posted on 2010-09-18
8
318 Views
Last Modified: 2012-05-10
HI,

Once I click on button,I want to show pregrs icon and avoid multiple button clicks How can I do that.

It is a windows application I am developing using Vb.net and vs 2005

Thanks
0
Comment
Question by:futurebuilders
[X]
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
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33708719
hi...If i were you :
1.an image list with a number of images..
2.a picture box
3.loop through the image list items count with a required delay.
Hope it helps
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33709037
In general, you disable the button, do your thing, pump the queue with Application.DoEvents(), then re-enable the button.

Add a ProgressBar to your form and toggle its visibility.

Can you explain what you need to show the progress of?...
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33709136
i thing i misunderstood right @idle?
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 33709177
Not sure...I think he also might want the "busy" cursor icon to show instead of an actual progressbar?

So hard to interpret questions sometimes...  =)

Maybe something like:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Enabled = False
        Me.Cursor = Cursors.WaitCursor()

        ' ... do something in here ...

        Application.DoEvents() ' <-- this is what keeps the "queued" button clicks from being processed
        ' (As long as we call DoEvents() BEFORE the button is turned back on) 
        Me.Cursor = Cursors.Default
        Button1.Enabled = True
    End Sub

Open in new window

0
 
LVL 12

Accepted Solution

by:
Mohamed Abowarda earned 250 total points
ID: 33710682
The best way to do so without disabling the button:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Me.UseWaitCursor Then
            Exit Sub
        End If
        Me.UseWaitCursor = True

        ' TODO: Add you code here...

        Me.UseWaitCursor = False
    End Sub

Open in new window

0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33712084
You may also use various "spinners" they look cool and catch the attention of the user. The .NET picture box supports animated GIF so you can create your own "spinner" and place it next to the command button while the code in the button does work. The button should be disabled though when you activate the "spinner". I would stick with a green, orange or light blue color only and never red unless you want to indicate an error to the user. You may have to use threading if you can't pump the message queue with just the code in the button. This is only recommend for special situations so don't go putting spinners all over the place!
I use either green or this blue #0099CC

This site can build them in a variety of different shapes, sizes and colors!
http://www.ajaxload.info/#preview

blue-spinner.gif
0
 

Author Closing Comment

by:futurebuilders
ID: 34478706
thanks
0
 

Author Comment

by:futurebuilders
ID: 34478707
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 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