Solved

Buttons on a form

Posted on 2000-03-20
7
132 Views
Last Modified: 2010-04-04
How do you get more than one button on a form to be activated at a given time. I have a program performing a simulation which is in a loop and this simulation is started after clicking one of the buttons(start), the other button is a stop button. I want to know how I can stop the simulation despite of it being in a loop therefore how to activate the stop button. I am using delphi 2.0.
0
Comment
Question by:Dushi
  • 4
  • 2
7 Comments
 
LVL 7

Expert Comment

by:RBertora
ID: 2636085
Place this line of code in your loop:
Application.ProcessMessages;

Rob;-)
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2636099


0
 
LVL 7

Accepted Solution

by:
RBertora earned 50 total points
ID: 2636108
//global variable:
var
  Stop : Boolean;

//onformcreate:
  Stop := False;

//button2click:
Stop := True;


//button1click:
begin
  //your loop condition
  while (blateblah ) and (Stop := False)
  //lalalla
  application.processmessages;
  end;
  Stop := False;
end;

Rob;-)
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 2636111
wow, what for an empty comment, rob :-))
0
 
LVL 7

Expert Comment

by:RBertora
ID: 2636305
I suddenly realised my first comment (posted as an answer was insufficient) so I removed it as answer and posted the answer instead... I suppose its just the thought of going up a position ont the top15 that made me trigger happy... Doup!

Rob;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2636401
:-)))
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2636615
has started to use again (i got told off so many time for it) make comment as answer.....  and i have to use this method or nobody reads my comment :(

(if everyone stops answering questions for about a 100 years i may get into the top 15)

Craig C, getting depressed
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 73
Delphi inherited method 6 42
how can i search if string exist in array ? 3 34
Base1 Encode/Decode 3 39
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

9 Experts available now in Live!

Get 1:1 Help Now