Solved

Making a stop button stop the routine.

Posted on 2006-07-04
2
236 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
Comment Utility
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
Comment Utility
Thanks that makes sense.
David
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 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

6 Experts available now in Live!

Get 1:1 Help Now