Jump to content

Recommended Posts

Posted
 
Write the form name transfer in the Create, such as form1, the form will automatically create the display. I just need to do form1 variable transmission. How to do?
 
procedure TFMain.UniFrameCreate(Sender: TObject);
begin
   Form1;    //Automatically displayed Form1, not what I need 
End;
 
=========================
I need
 
 
protected
       FName:TUniForm;
 
procedure TFmain.UniFrameCreate(Sender: TObject);
begin
      FName:=Form1;        //You do not need to show
end;
 
procedure TFmain.btnAddClick(Sender: TObject);
begin
    FName.ShowModal(showcallback);
end;
 

 

 

Posted

Use free form 

And put in variable formclass instead form

protected
       FName:TUniFormClass;
 
procedure TFmain.UniFrameCreate(Sender: TObject);
begin
      FName:=TForm1;    
end;
 
procedure TFmain.btnAddClick(Sender: TObject);
begin
  TUniFormClass(FName).Create(UniApplication).ShowModal(showcallback);
end;
Posted

 

Use free form 

And put in variable formclass instead form

protected
       FName:TUniFormClass;
 
procedure TFmain.UniFrameCreate(Sender: TObject);
begin
      FName:=TForm1;    
end;
 
procedure TFmain.btnAddClick(Sender: TObject);
begin
  TUniFormClass(FName).Create(UniApplication).ShowModal(showcallback);
end;

 

 

 

thank you,OK

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...