Please enable JavaScript to view this site.

Codolex

Navigation: Activities > Dialogs

Show modal form

Scroll Prev Top Next More

Show modal form can be used to open any TCustomForm available in the project.

uses Vcl.Forms.TCustomForm.ShowModal

 

OpenModalForm

Activity properties

 

begin

var ModalResult: Integer;

var Form := TFormClassName.Create(nil);

try

  //code to initialize Form

   ModalResult := Form.ShowModal;

finally

   Form.Free;

end;

end;

Resulting code

 

Namespace and folder class must be used to select the TCustomForm class that must be opened.

 

The initialization code will be added just before opening the form. The code can be used to call a function/procedure to set values of the class.

The initialized form can be referenced with 'Form'.

 

The modal return value will be stored in an integer when provided.

© by GDK Software