[VB.NET] Help PLEASE!

Status
Not open for further replies.

123max

Member
Original poster
member
Joined
Jul 12, 2010
Posts
1,454
Reaction score
182
Points
66
Ok so here is the thing i want to do:
Basically On clicking a button a dialog loads up and it has a button when pressed the loading bar starts to load. But i want it to change the text in the text box as it is loading example:
When it starts it says : Searching for File
When it is at 25% : File found verifying file
When it as at 50% : Registering File Info to the Server
just like the installation status over the loading bars.

Here is my code but it won't work! (it only says loading values dosen't change to Registring :( )
Code:
Timer1.Start()
        ProgressBar1.Value = 1
        If ProgressBar1.Value = 1 Then TextBox1.Text = " Loading Values "
        If ProgressBar1.Value = 25 Then TextBox1.Text = "Registering Values"

The rest is followed by ProgressBar1.Increment(1) in the Timer box!

bumppppppppppppppp

bummmmmpppppp
 

Ace12

Senior
senior
Joined
May 2, 2011
Posts
1,013
Reaction score
369
Points
91
Location
Toronto
You are not incrementing anything - you just defined the value of 1 to progressbar1 in the timer. What you want to do is when the form loads, then start Timer1.

In Timer1 put the following code:

Code:
        ProgressBar1.Value = ProgressBar1.Value + 1

        If ProgressBar1.Value = 1 Then 
               TextBox1.Text = " Loading Values "
        End If

        If ProgressBar1.Value = 25 Then 
               TextBox1.Text = "Registering Values"
         End if

^ It will add a value of +1 each time at the interval. If the Timer1's interval is 1000 Then every 1 second it will increment by 1 and when it reaches value 25 or after 25 seconds, textbox1 will say "Loading Values".
 
  • Like
Reactions: 123max
Status
Not open for further replies.