Hello,
>wait for user to click on the button and continue
=
ShowMessage('Click me');
If you're talking about a specific button somewhere on a form, give us a bit more details:
- what calls "while 1 do ..."?
- is it a member of the same form where the button is. Or it is a part of a standalone procedure?
- can the second procedure be a method of that form also?
- there might be more questions later on...
Regards, Geo
Main Topics
Browse All Topics





by: ciulyPosted on 2006-05-20 at 05:34:51ID: 16724219
there is evry little information and too many solutions to point you in teh right direction for your situation. so here are a few solutions: s; then
- use a modal form that only has one or 2 buttons (like ok, cancel) and do a showmodal instead of the "wait for user to click on the button and continue"
- if the button doesn't have an event associated then:
write an onclick event handler in it set the variable isok to true;
assign the new onclick event handler to te buttons onclick event
(the above is done only once) now comes the while 1 do
set a variable isok to false;
instead of "wait for user to click on the button and continue" do:
while not isok do
begin
application.processmessage
sleep(50);
end;
while 1 do is now finished
set the onclick event of the button to nil
- if the button has an event handler, do as above, but:
first save the event handler to say buttonclicksaved
after the while not isok do
if assigned(buttonclicksaved)
buttonclicksaved(this);// to call the saved event handler
at finish, instead of settting the button event to nil, set it to buttonclicksaved