Private Sub ProgressBarCalistir()
'---------------------------------------------------------------------------------------
'---------------------------------------------------------------------------------------
' Procedure : btn_Test_Click
' Author : AEC - Anders Ebro Christensen / TheSmileyCoder
' Date : 2013-03-17
' Version : 1.0
' Purpose : Simulate a test of the progress form, and demo example usage
' Bugs? : Email: SmileyCoderTools@gmail.com
'---------------------------------------------------------------------------------------
'---------------------------------------------------------------------------------------
On Error GoTo Err_Handler
Dim i As Integer
'Init progress form
Dim oPF As TSC_PF_Simple
Set oPF = New TSC_PF_Simple
'Show the form
oPF.Title = "SoFT Tekstil Sistemine Bağlanıyor.." & vbNewLine & "Lütfen Bekleyiniz..."
oPF.UpdateTask 0, "Datebase Yükleniyor..."
oPF.Show
'Since this is just a demo, I simulate a series of slow tasks by using the sleep
oPF.UpdateTask 0, "Sistem Dosyaları Aktarılıyor...: " & vbNewLine & 1 & " of 10"
For i = 1 To 10
Sleep 100
oPF.UpdateTask i / 10, "Form Analizi Yapılıyor...: " & vbNewLine & i & " of 10"
Next
'The progress form allows the user to cancel a running process, however, not that
'the cancel is only reacted to when the progress form is updated.
'If you want to allow the user the possibility to cancel, set the Allowcancel property to true
'If user cancels an an error 8101 is raised.
oPF.AllowCancel = True
'Simulate another task running
oPF.UpdateTask 0, "Sistem Cagırılıyor...:" & vbNewLine & "1 of 10"
For i = 1 To 5
Sleep 500
oPF.UpdateTask i / 5, "Hatalar Aranıyor...:" & vbNewLine & i & " of 10"
Next
'Simulate a third task running, but now disallow cancel for this part
oPF.AllowCancel = False
'Also change the titel. Note how the form expands to accomodate the long text
oPF.Title = oPF.Title & vbNewLine & "Sistem Güncellendi."
oPF.UpdateTask 0, "Hatalar Düzenleniyor...:" & vbNewLine & "0 of 100"
For i = 1 To 100
Sleep 25
oPF.UpdateTask i / 100, "Veri Güncelleniyor...:" & vbNewLine & i & " of 100"
Next
'Update title before closure. Note how the built in close delay gives just
'enough time for the user to see this message.
oPF.Title = "SoFT Tekstil e HoşGeldiniz" & vbNewLine & "Program Aciliyor..."
Exit_Sub:
'Cleanup
Set oPF = Nothing
On Error GoTo 0
Exit Sub
Err_Handler:
'Check for user cancel
If Err.Number = TSCe_ErrCodes.PF_UserCancel Then
'User has clicked cancel. How you wish to react is of course entirely based on your demands
'If you do not wish to bother with this, just leave the AllowCancel at the default False setting.
MsgBox "Serkan ERDUGAN"
Resume Exit_Sub
End If
'Some other other
MsgBox "Error in btn_Test_Click" & vbNewLine & "[" & Err.Number & "] - " & Err.Description, vbOKOnly
Resume Exit_Sub
End Sub
kodu ekle,
login butonunun tıklandığında olayındaki kod içerisine
call progressbarcalistir
kodu ekle.