Visual basic: Adding a progress bar

mrapoc

New member
Basically I want to add a time-based progress bar purely for appearance.

I know i need to either make a loop or, use a time based command. My lecturer didnt want to go that far but hes pleased im experimenting and wants me to have a go at home/do some research.

Im basically just trying to see how many simple yet cool things i can implement.

Heres is my code, you can probably guess what it does if you know how to add this damn progress bar!

Public Class Form1

Private Sub ButtonPress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonPress.Click

'gives a message related to user's name and shows time

LblOutput.Text = "Hello, " & TBInsertText.Text & ", Would you like to see a cool picture?"

LblOutput.Visible = True

TheTime.Text = "The time is: " & TimeOfDay

TheTime.Visible = True

End Sub

Private Sub TBInsertText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TBInsertText.Click

'blanks text from box when clicked for user input

TBInsertText.Text = ""

End Sub

Private Sub ButtonPress_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ButtonPress.MouseClick

'makes button visible after pressing "press me"

PictureButton.Visible = True

End Sub

Private Sub PictureButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureButton.Click

'Makes picture button blue when pressed and makes progress bar visible

PictureButton.BackColor = Color.Blue

ProgressBar1.Visible = True

End Sub

End Class

Cheers
 
something along the lines of

// create progress bar

ProgressBar pb = new Progressbar();

container.add(pb);

//fill it over time

for (pb.value = 0; pb.value < pb.max; pb.value++) {

thread.sleep(100);

}

I don't know VB but im sure you can work out the equivalent. If not look for a tutorial somewhere on the web, google is your friend.
 
I have been trying for ages but it just doesnt seem to work at all :(

Ill have another mess around but im not sure
 
Hmm that I could...like edit out the gif in my sig, put it in then set a timer to initialise the next part soon as the bar fills?

Ill need to get my lecturer to help me with the timer/loops command needed
 
*** Uses a Guerrilla bomb deployment tactic***

Booooooomm!!!!!!!

*DIE Crap Programming Language*

 
Back
Top