Solved

Progressive icon in vs2005

Posted on 2010-09-18
8
308 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

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

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 …
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
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…

776 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