Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/session/session.php on line 426

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/ferasferas1/html/scriptslibrary/libraries/joomla/database/database.php:2) in /home/content/f/e/r/ferasferas1/html/scriptslibrary/templates/ja_purity/ja_templatetools.php on line 49
Progressbar in VB.NET - The Scripts Library Community

Free Programming Tutorials & Source Code

 
  • Increase font size
  • Default font size
  • Decrease font size
Home Visual Basic.NET Progressbar in VB.NET

Progressbar in VB.NET

E-mail
(0 votes, average: 0 out of 5)
Here is a simple example of how progressbar works. First, create a form, and name it as frmSplash. Add a timer, a progressbar, and a label. Name the timer as Tr, and set the internal to 1000 (1 second) Name the progress bar as pb. Name the label as lbl. Create another form, and name it as frmMain. Now, open the frmsplash, and write the following code to enable the timer:
 
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
tr.Enabled = True

End Sub
Then, add this code to when the timer tricks:
 
Private Sub tr_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles tr.Tick

pb.Value += 5

If pb.Value <= 40 Then
lbl.Text = "Initializing....."
ElseIf pb.Value <= 60 Then
lbl.Text = "Loading personal settings....."
ElseIf pb.Value <= 80 Then
lbl.Text = "Connecting to Database...."
ElseIf pb.Value <= 100 Then
lbl.Text = "Connection established..."
End If

If pb.Value = 100 Then
tr.Dispose()
Me.Visible = False

nfrmMain = New frmMain()
nfrmMain .Show()
End If

End Sub

Run the program. You can choose to start a main form after this splash, or a login form.