Showing posts with label delphi - forms. Show all posts
Showing posts with label delphi - forms. Show all posts

Thursday, November 30, 2017

DELPHI - How show modal form

TFMissing is class with form.
var
  FMissing : TFMissing;
begin
  FMissing := TFMissing.Create( self );
  
  { -- optional: here you can send some initial data to the form  
  FMissing.Prepare( DataColumn );
  }
  
  FMissing.ShowModal;

  { -- optional: here you have possibility read output from (closed) form   
  Grid.Cells[ _iCol, _iRow ] := pDataColumn.pMissings.GetAsString; 
  }

  FMissing.Free;
end;

Wednesday, November 29, 2017

DELPHI - How properly close non-modal window

Override event FormClose:
procedure TFGauge.FormClose( Sender: TObject; var Action: TCloseAction );
begin
  Action := caFree;
  self   := nil;
end;