Ver Mensaje Individual
  #6  
Antiguo 23-02-2022
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Si por llamarse te refieres a crearse, podrías hacerlo de este modo:

MDIForm:
Código Delphi [-]
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;

type
  TMDIForm = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MDIForm: TMDIForm;

implementation   {$R *.dfm}

uses Unit2;

procedure TMDIForm.Button1Click(Sender: TObject);
begin
  TMDIChild.ShowChild(IntToStr(111));
end;

procedure TMDIForm.Button2Click(Sender: TObject);
begin
  TMDIChild.ShowChild(IntToStr(222));
end;

procedure TMDIForm.Button3Click(Sender: TObject);
begin
  TMDIChild.ShowChild(IntToStr(333));
end;

procedure TMDIForm.Button4Click(Sender: TObject);
begin
  TMDIChild.ShowChild(IntToStr(444));
end;

end.

MDIChild:
Código Delphi [-]
unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TMDIChild = class(TForm)
    Edit1: TEdit;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
    class procedure ShowChild(const Value: string);
  end;

var
  MDIChild: TMDIChild;

implementation {$R *.dfm}

class procedure TMDIChild.ShowChild(const Value: string);
begin
  MDIChild := TMDIChild.Create(nil);
  MDIChild.Edit1.Text := Value;
end;

procedure TMDIChild.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

end.

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita