Jump to content

panel with fixed height


daniel@winarhi.ro
 Share

Recommended Posts

Hello

I cannot make (and I've tried in countless ways) to make a form with 2 horizontal panels, the top one with fixed height (150) and the second one filling the rest of the form. What I think that should work is something like:

 

object UniForm1: TUniForm1
  Left = 0
  Top = 0
  ClientHeight = 695
  ClientWidth = 1021
  Caption = 'UniForm1'
  BorderStyle = bsNone
  WindowState = wsMaximized
  OldCreateOrder = False
  MonitoredKeys.Keys = <>
  AlignmentControl = uniAlignmentClient
  Layout = 'border'
  PixelsPerInch = 96
  TextHeight = 13
  object UniPanel1: TUniPanel
    Left = 360
    Top = 40
    Width = 256
    Height = 128
    Hint = ''
    CreateOrder = 1
    TabOrder = 0
    Caption = 'UniPanel1'
    LayoutConfig.Height = '150'
    LayoutConfig.Region = 'north'
  end
  object UniPanel2: TUniPanel
    Left = 360
    Top = 208
    Width = 256
    Height = 128
    Hint = ''
    CreateOrder = 2
    TabOrder = 1
    Caption = 'UniPanel2'
    LayoutConfig.Region = 'center'
  end
end
 
But it doesn't workt. The top panel is always of some fixed height but not the height which I specify. The only way to change the height of the top panel is to put some percentage in LayoutConfig.Height, (like LayoutConfig.Height ='20%') but this is not what I want. I want a fixed height.
I've tried also with vbox and with anchor layout but it doesn't work either.
 
Someone help me please.
Thank you,
Daniel
Link to comment
Share on other sites

OK....found a solution:

 

-the form's layout: anchor

-the top panel: LayoutConfig.Anchor = '100%' and the Height = 150 (this is for the fixed height which I wanted for the top panel).

-and the not intuitive at all solution for the bottom panel: LayoutConfig.Anchor = '100% 0'

 

Also the panels CreateOrder must be set from top to bottom.

 

It doesn't work for browser window resize but is better than nothing.

If someone has a better approach please reply.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...