Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Progressive icon in vs2005

Posted on 2010-09-18
8
Medium Priority
?
327 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

877 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