Jump to content

Recommended Posts

Posted

Hi Ronny

 

When you say frames, you are talking about TUniFrame?

 

If so, this is the way I do it, and it work fine for me:

 

I Have a main form, in this form there is a UniPanel, then I have a procedure that I invoke to show my frames

 

For example on a Button click:

 

LanzarVentana(Sender);

 

 

I have these variable in private:

 

    FFrameTag : Integer;
    FFrameName : string;
    FCurrentFrame : TUniFrame;
 

 

 

And the procedure:

procedure TMainForm.lanzarVentana(Sender: TObject);
begin
  if FFrameTag = TComponent(Sender).Tag then Exit;

  FFrameTag := TComponent(Sender).Tag;

  if Assigned(FCurrentFrame) then begin
    FreeAndNil(FCurrentFrame);
  end;
  FFrameOpcionName := '';


  case FFrameTag of
  0:  begin
        FCurrentFrame           := TUniFrameClass(FindClass('TfrEstudiantes')).Create(Self);
        FFrameName              := 'Estudiantes';
      end;
  end;

  if Assigned(FCurrentFrame) then begin
    FCurrentFrame.Align   := alClient;
    FCurrentFrame.Parent  := pnCentro;
  end;
  Caption           := FFrameName;
  lbTitulo.Caption  := FFrameName;
end;

Also the Mega Demo use frames, you can see there.

 

I hope this help you.

 

Regards

 

Rafael Liriano

  • Like 1

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