473,473 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Process Endless Until Button Press

1 New Member
I'm building a simple ASP.NET Windows application

One the Windows Form there is a Button.

If you click on it it calls a subroutine

What I want to do is the Sub routine once it complete start all over
This should repeat until the button on the form is pressed again.

The button is a toggle for process or not. But when it is processing and it's done, it need it to repeat again.

I can get it to work without the repeating.

Any ideas or sampe code.
Feb 28 '08 #1
2 1071
Plater
7,872 Recognized Expert Expert
Hmmm, is your project an ASP.NET project or a windows application? They're mutually exclusive.
Feb 28 '08 #2
balabaster
797 Recognized Expert Contributor
Hmmm, is your project an ASP.NET project or a windows application? They're mutually exclusive.
Sounds like a Windows application...I'd create a thread in the startup of the form and have the thread wait at a manual reset event.

Expand|Select|Wrap|Line Numbers
  1. Private Semaphore As New System.Threading.ManualResetEvent(False)
  2.  
  3. Private Sub WorkerThread(ByVal Args As Object)
  4.   While True
  5.     Semaphore.WaitOne() 'Your code will wait here until the button is clicked
  6.     'Do your other stuff here...
  7.   End While
  8. End Sub
  9.  
  10. Private Sub ToggleButton_Click(ByVal Sender As Object, ByVal e As System.EventArgs)
  11.   If Semaphore = False Then
  12.     Semaphore.Set
  13.   Else
  14.     Sempahore.Reset
  15.   End If
  16. End Sub
  17.  
  18. Private Sub Form_Load(ByVal Sender As Object, ByVal e As System.EventArgs)
  19.   Dim oThrd As New System.Threading.Thread(AddressOf WorkerThread)
  20.   oThrd.Start
  21. End Sub
  22.  
Feb 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: LarsenMTL | last post by:
Python Users: Based on previous suggestions from this group, I'm attempting to write a python CGI that takes input from an HTML form, invokes a second python script using this input, tells the...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
0
by: rob | last post by:
Hello, I have a DOS program that I need to execute from a WinForm application. This DOS program will take a long time to execute. During execution it prints out messages. While the DOS program...
1
by: Hai Le | last post by:
Hi, I'm trying to write a program for Smartphone 2003 device bu eVC++ 4.0. The interface consists of couple of buttons ( i used pushbutton type), when you press the button, the program start to...
1
by: Peter Row | last post by:
Hi, BACKGROUND: I have a VB.NET DLL that uses HttpModules, HttpHandlers etc... which has been ported from a VB6 webclass application. I am developing on WinXP Pro SP1, P4 2Ghz, 512MB Ram I...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
4
by: ImSoLost | last post by:
I'm running a really long process from ASP.NET and need some help... I am making a method call when the user presses a button from my webpage, which goes into a database and parses a file. This...
2
by: Thomas tang | last post by:
hello everyone, i am an ASP new comer, i have write a simple asp application, which is used to send batch email. the process will running for few hour, it depend on how much email needed to send....
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.