Jump to content

FORM Dinâmico com Page Control


vcadanos

Recommended Posts

Boa Tarde,

Estou fazendo alguns testes com unigui usando um exemplo do Afonso(//

Só que  uma coisa que não consegui foi que ao adicionar por exemplo um grid dentro do frame ao carregar o tabsheet que é criado dinamicamente não fica alclient ..

Ja aquelas tabsheet que eu crio fixo funciona legal, preenchendo a tela toda., Alguém tem alguma dica ou um exemplo segue o código que uso para criar a tabsheet dinamicamente.

 

procedure TMainForm.NovaAba(nomeFormFrame: TFrame; descFormFrame: string; Fechar: Boolean);
var TabSheet      :TUniTabSheet;
    FCurrentFrame :TUniFrame;
    I             :Integer;
begin

      pagePrincipal.Visible := True;

      {Verificando se a tela já está aberto e redireciona a ela}
      for I := 0 to pagePrincipal.PageCount - 1 do
        with pagePrincipal do
          if Pages.Caption = descFormFrame  then
            begin
              pagePrincipal.ActivePageIndex := I;
              Exit;
            end;

      TabSheet              := TUniTabSheet.Create(Self);
      TabSheet.PageControl  := pagePrincipal;
      TabSheet.Caption      := descFormFrame;
      TabSheet.Closable     := Fechar;


      FCurrentFrame:= TUniFrameClass(nomeFormFrame).Create(Self);

      with FCurrentFrame do
        begin
          Align               := alClient;
          Parent              := TabSheet;
        end;

      Refresh;

      pagePrincipal.ActivePage := TabSheet;
end;

 

 

 

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...