Solved

Progressive icon in vs2005

Posted on 2010-09-18
8
305 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

21 Experts available now in Live!

Get 1:1 Help Now