How to Make Modal Form?
Just a short notice how to make modal forms in Delphi. Assume, you have two Forms: AForm and BForm. AForm is your main form and you want now to call B as modal form (a modal form is a child form that requires the user to interact with it before it gets possible to return to the parent form). So inside your AForm you call BForm in the following way:
procedure AForm.Button1Click(Sender: TObject);
var b : BForm;
begin
b := BForm.Create(nil);
try
if b.ShowModal = mrOk then begin
// your code if OK Button is clicked
end
else begin
// your code, if cancel is clicked
end;
finally
b.Release;
end;
end;
On your BForm you need two Buttons. One of them you use for Ok and the other one for Cancel. The only thing you need to do is to chage respectively the ModalResult property of these buttons as shown in the picture bellow:

That’s all. Notice, that the value of the Visible-property of your BForm should be false.

I bet you wish george bush was still president now
author: Mrs. Anti-Virus | August 15th, 2010 at 12:06 pmwats up man hows it going
author: 22 inch car rims | August 17th, 2010 at 2:47 pm