Solved

Buttons on a form

Posted on 2000-03-20
7
133 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
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.

 
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

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

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 167
Working this component WebCopy with proxy, help 3 76
delphi parse string to params 3 97
Delphi...Split view - idea? 1 39
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

947 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

21 Experts available now in Live!

Get 1:1 Help Now