| | |
Pause Execution of a vb.net application
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
Try something like this:
The inner loop just waits untill the OverDone is toggled.
VB.NET Syntax (Toggle Plain Text)
Private Sub btnLoop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoop.Click Do While Not Done My.Application.DoEvents() Do While OverDone My.Application.DoEvents() Loop Loop Started = False Done = False OverDone = False End Sub Private Sub btnToggleDone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnToggleDone.Click If Started Then Done = Not Done End If End Sub Private Sub btnToggleOverdone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnToggleOverdone.Click If Started Then If Not Done Then OverDone = Not OverDone End If End If End Sub
•
•
Join Date: Jul 2006
Posts: 3
Reputation:
Solved Threads: 0
Hello,
thank you for your reply. I have some questions. In my code I am retriving binary files from a database and all its related information from other tables to send them to another database using webservices. My outer loop is my records from the database, what is the inner loop?
dose btnToggleDone and btnToggleOverdone my pause and resume buttons?
thanks
thank you for your reply. I have some questions. In my code I am retriving binary files from a database and all its related information from other tables to send them to another database using webservices. My outer loop is my records from the database, what is the inner loop?
dose btnToggleDone and btnToggleOverdone my pause and resume buttons?
thanks
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
•
•
•
•
Originally Posted by Ayati
Hello,
thank you for your reply. I have some questions. In my code I am retriving binary files from a database and all its related information from other tables to send them to another database using webservices. My outer loop is my records from the database, what is the inner loop?
dose btnToggleDone and btnToggleOverdone my pause and resume buttons?
thanks
•
•
•
•
Private Sub btnTogglePauseContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTogglePauseContinue.Click
If Started Then
If Not Done Then
OverDone = Not OverDone
End If
If OverDone = True Then
btnToggleOverdone.Text = "Resume"
Else
btnToggleOverdone.Text = "Pause"
End
End If
End Sub
Last edited by waynespangler; Jul 20th, 2006 at 6:35 pm.
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
VB.NET Syntax (Toggle Plain Text)
Private Sub btnTogglePauseContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTogglePauseContinue.Click If Started Then If Not Done Then OverDone = Not OverDone End If If OverDone = True Then btnToggleOverdone.Text = "Continue" Else btnToggleOverdone.Text = "Pause" End End If End Sub
Hi,
You can use System.Threading.Thread.Sleep(200) in the inner loop along with Application.DoEvents() to avoid CPU overhead.
Loren Soth
You can use System.Threading.Thread.Sleep(200) in the inner loop along with Application.DoEvents() to avoid CPU overhead.
Loren Soth
Best regards,
Loren Soth
Crimson K. Software _________________________________________________________________ Crimson K. Blog
Loren Soth
Crimson K. Software _________________________________________________________________ Crimson K. Blog
![]() |
Similar Threads
- win98 and vb.net application with crystal reports (VB.NET)
- Asp.net: Deployment Of .net Application In Windows 2003 Server (ASP)
- asp.net application in MAC OS (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Small matter regarding vb.net dll
- Next Thread: A quick question
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial shutdown soap sorting survey table tcp temperature text textbox timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





