Delphi tip , layout panel 100% width flex auto fit panel delphi

Este truco es para hacer un formulario tipo web ,divido en top, left , right y que sea width 100% cosa que no se puede en delphi.
3 paneles con la propiedada align

The trick is to make a web standard form, divided into top, left, right and width is 100% thing is not in Delphi.3 panels with the align property

object ContainerTop: TPanel
    Left = 0
    Top = 0
    Width = 895
    Height = 66
    Align = alTop
    BevelOuter = bvNone
    Color = clGradientInactiveCaption
    ParentBackground = False
    TabOrder = 0

  object ContainerRigth: TPanel
    Left = 401
    Top = 66
    Width = 494
    Height = 382
    Align = alClient
    BevelOuter = bvNone
    Color = 10485760
    ParentBackground = False
    TabOrder = 2
    ExplicitTop = 73
    ExplicitHeight = 375

  object ContainerLeft: TPanel
    Left = 0
    Top = 66
    Width = 401
    Height = 382
    Align = alLeft
    BevelOuter = bvNone
    Color = clBackground
    ParentBackground = False
    TabOrder = 1
    ExplicitTop = 73
    ExplicitHeight = 375

y finalemente en el evento resize cambiamos el width del panel izq y asi se acomoda todo
and finally in the resize event changed the width of the left panel, and so fits all

procedure TForm1.FormResize(Sender: TObject);
begin
//Panel alineado 100%
ContainerLeft.Width := Trunc( Self.Width / 2);
end;


PICS






0 pensamientos:

Post a Comment

feedback!