|
-
June 14th, 2012, 04:28 AM
#1
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?
-
June 14th, 2012, 06:54 AM
#2
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...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
June 14th, 2012, 07:45 PM
#3
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|