Jump to content

Problem with the frames


rencarnacion

Recommended Posts

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...