473,750 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to creat a stop button to stop the process in VC++

friendjin
19 New Member
Thanks in advance;

Can I ask a question about VC++.NET 2003.
about using window form application.
when I click button1, the programming will be run, and the
results will be displayed in textbox1, we are able to see update values in
textbox1, to achieve this function, I used the while loop to loop forever.
you know the problem is it could not be stopped.
So I want to create a stop button, once I click this button, it should be
stopped immediately, but not exist the form.
e.g
Expand|Select|Wrap|Line Numbers
  1. private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
  2. {
  3. while(true)]
  4. {
  5. }
  6. }
  7. private: System::Void button2_Click(System::Object *  sender, System::EventArgs *  e)
  8. {
  9. }
  10.  
But I have no idea how to write the code for stopping.
can anybody give me some idea?
Feb 14 '07 #1
1 1823
friendjin
19 New Member
someone told me I could use thread.. as once clicking the start button, the proccess will keep running, at the same time, it is impossible to click the stop button. have to using some way to start another process during the previous process running.

but i have no idea how thread works. anyone can give me some idea. thanks.
Feb 16 '07 #2

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

Similar topics

3
15451
by: Sunny | last post by:
Hi All I am creating a C# app, in which there are some methods that are considerably longer than the others and take a few minutes to complete, I want to give the users an option to stop that method (which is in process). I want to include a command button using which the user of the app, can stop that process. Another thing that i want to add is that, while stopping the mthod execution, i do not want the Windows Form to close, only the in...
26
4697
by: Ricardo | last post by:
I made a program that generate random numbers and put it in a listbox when the user click go. The problem is: how can i made a button stop, to stop the method that is running??? s...
8
3521
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with inline code. The page has a Datagrid, a textbox and a button. When the button is clicked, the value of the textbox is inserted into the table whose contents are displayed on the page. The problem occurs when I set a breakpoint on a line *IN*...
3
2471
by: prakashsha | last post by:
HI, I've an asp.net page which has a button. On click of the button the program queries the database and gets the result and displays the same.Now assume that my program takes 2 minutes to get the results.In the mean time if the user press Esc button to stop the process. The page will stop processing but my database connection will be trying to retrieve the records. How to solve this ??? Thanks in Adavance.
4
1961
by: Chip | last post by:
Can somebody explain to me why my process continues to run after I halt execution? This plays havoc with debugging. I expect to be starting a new instance at the beginning of a loop and the first break point hit is thousands of itterations into the process (from a previous instance). I get a very random step behavior. Know I am watching a database continue to be updated 10 minutes after I stopped the front-end process. I have to stop IIS...
7
2275
by: jab3 | last post by:
Hello. I'm wondering if someone can answer something I'm sure has been answered a thousand times before. I am apparently just too dumb to find the answer. :) I've found information about the 'onstop' event, but it's not behaving as expected. (And it also seems to be a proprietary attribute) That is, my defined function is not being run when I click stop. I've 'inserted' it like this: <body onstop="stopped_clicked()"> And the function...
1
1724
by: AE_Cory | last post by:
I'm a n00b to Visual C++ and OOP, but not to programming in general. Here's the problem: Not knowing what I'm doing, I've made my VC++ application as a CLR Window Forms project. Now, I have a process that is lauched by pushing a button. The code for this process is inside the Button_Click event handler for that particular button. The problem is that I need to be able to kill that process with another button. I have a global flag...
1
2770
by: dhanuka | last post by:
hai i hop to creat a program in vb, it must be a registration form through the program we have to add some details for this program Ex - we have to add some persons details i can creat that part but i have no any idea about how that detail save and how it add for my program Ex - need to save all the detail and as we whish want to display it agin as the definition it has thes conditions 1.to save all the persons details 2.as we...
3
1841
by: shimajavar | last post by:
Hi all I have the following code: a line is growing up by clicking on "up" button, it has another button"start" which I want it to stop the process of growing the line...How can I make a button to stop the process of another button? class Program: Form { int x1; int y1; int x2;
0
9000
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9396
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9339
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6804
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
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 we have to send another system
2
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.