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

Progressive icon in vs2005

Posted on 2010-09-18
8
310 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
  • 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 85

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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 
LVL 85

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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