Solved

Making a stop button stop the routine.

Posted on 2006-07-04
2
237 Views
Last Modified: 2010-04-16
Hi
I am using VC#.
On the main form I have a start button which calls a routine to start taking voltage measurments and displays the measured data. The full test can take several hours. I need to have another button on the form, STOP, to stop this routine at any stage.
I have tried adding a button but when the main routine starts the stop button has no affect, the code here never gets called.
How can I structure the program so that the buttons on the form still work.

David
0
Comment
Question by:davidw007
2 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 500 total points
ID: 17035610
Hi davidw007,
----------

you could look into using threads for this because you could kill a worker thread on the main thread in your commandbutton code
http://msdn2.microsoft.com/en-us/library/7a2f3ay4.aspx

----------
bruintje
share what you know, learn what you don't
0
 

Author Comment

by:davidw007
ID: 17036049
Thanks that makes sense.
David
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now