Problem opening form inside panel

Asked

Viewed 1,157 times

1

I’m trying to open a form inside a panel in Delphi, but apparently, the form opens with the same size as the panel, but outside it.

I did so...

UniForm1.Parent := UniPanel1;
UniForm1.Show;

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • Try setting the form property Positionfor poOwnerFormCenter

  • It made no difference...

2 answers

1


I solved with the following code, in addition to changing the Windowstate of wsMaximized for wsNormal and the Position for poDefaultPosOnly.

UniForm1.Width := UniPanel1.Width;
UniForm1.Height := UniPanel1.Height;

0

If you use a Frame instead of a Form you can do what you want.

  tuaFrame:=TUniFrame1.Create(self);
  tuaFrame.Parent:=teuPainel;
  tuaFrame.Align:=alclient;
  tuaFrame.Visible:=true;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.