Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello codeproject,
i have a progressbar1 control with maximum value = 100
i want to my progressbar value decrease 10 value every 40 second.
so in the first 40 second, my progressbar value = 90
and next 40 seconde, my progressbar value = 80
and then if my progressbar1 value = 0 , i need some messagebox alert..

this is my code to execute messagebox every 1 minute but this is not working
VB
Public Sub test()
        Dim endTime As DateTime = DateTime.Now.AddMinutes(1)
        While endTime < DateTime.Now
            MessageBox.Show("asdsad")
        End While
    End Sub


any suggestion?
Posted

1 solution

Look up how to use Timers (System.Windows.Forms.Timer).

How you are doing it above will create a very unresponsive app (or windows may think its not working and ask if you want to close it and gray out the window).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900