Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Message box and Progress Bar Help!
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
atal




PostPosted: Sun Dec 25, 2011 2:07 pm   Post subject: Message box and Progress Bar Help!

code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TIMER1: ProgressBar1.Increment(25)
BUTTON1: Timer1.Start()

        MessageBox.Show("Message Here", "Title Here")


    End Sub


When ever I debug my program and press the button (Button1) the timer goes but does not finish because the message pops up. How do I make it so that the message pops up after the Progress Bar finishes? Thanks in advance.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Dec 25, 2011 2:38 pm   Post subject: RE:Message box and Progress Bar Help!

The timer is probably non-blocking. It will count something in parallel and maybe fire off some events. Check the documentation on specifics of how it works.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Night




PostPosted: Sun Dec 25, 2011 6:49 pm   Post subject: RE:Message box and Progress Bar Help!

I'm not quite sure what you're trying to do, but a couple of ideas based off of your code:

To make it stop once it reaches 100 (or the maximum value of the progress bar):

Add an If statement that checks if the value of the progress bar equals the maximum value of the progress bar. If yes, display the message box.

code:

        If ProgressBar1.Value = ProgressBar1.Maximum Then
            MessageBox.Show("Message Here", "Title Here")
        End If


Do something with the "tick" of the timer: (you'll have to enable it somehow; either via the button or enable it in the properties of the timer)

code:
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Increment(25)
    End Sub
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: