-
Progress Bar Running
I have the following code:
Code:
Private Sub btnConfirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConfirm.Click
Try
CheckSignature()
If flashBMSign = False And flashCustSign = False And flashConsSign = False Then
If FnProcessApproval() Then
If chkCOOApproval.Checked = True And strRole <> "COO" Then
MsgBox("Successfully pass the approval to COO!")
Else
MsgBox("Successfully Confirm Approval.")
End If
End If
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, Me.Text)
End Try
End Sub
May I know how can I put a progress bar to make it keep running when the function FnProcessApproval() is running and stop when the messagebox is display?
-
Re: Progress Bar Running
Look up worker threads, and use System.threading.thread ...
sample code i use to process reciepts
Code:
If MsgBox("Print receipt for this transaction?", MsgBoxStyle.YesNo Or MsgBoxStyle.DefaultButton1) = MsgBoxResult.Yes Then
Dim WT1 As New System.Threading.Thread(AddressOf PrintReceipt)
WT1.Start()
End If
Private Sub PrintReceipt()
Dim TmpPrinter As New Printers.PrinterModule("ID1")
Dim nr_of_copies As Integer
For nr_of_copies = 1 To Copies.KeyVal 'get nr. of copies as setup in File/Properties
TmpPrinter.Print()
Next
End Sub
In this I spawn a worker thread to take care of all the printing, and can now continue processing the transaction...
-
Re: Progress Bar Running
I tried your code, but how can I embedded my progress bar codes into the thread so that the bar will running?