Jump to content

call procedure/function on other form


donlego

Recommended Posts

hi..

is there any way to call function / procedure on other form like

if i have function/procedure on form  error

i create procedure like this

procedure TFrmError.Run(arun: integer; acaption: string; errornya: tstringlist);
var FrmError:TUniForm;
begin
  screen.Cursor := crhourglass;
  FrmError := TFrmError.Create(nil);
  with FrmError do
  begin
    try

      Caption := acaption;
      if caption = '' then caption := 'Error';
      caption := application.Title;
      Memo1.Text := errornya.Text;

      Memo1.Color := color;
      if FileExists(ExtractFilePath(Application.ExeName) + 'img\error.png') then
        Image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + 'img\error.png');
      FormStyle := fsStayOnTop;

      ShowModal;
    finally
      screen.Cursor := crDefault;
      FreeAndNil(FrmError);
    end;
  end;
end;

how i call that form procedure or function from another form ?

 

 

 

thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...