Question about the statusbar

Hi,

I have designing the layout of my application.
I have put the dfm in the code-section.

My questions:
1. when i get the horizontal splitter en drag it al the way down to the statusbar
    and up again, the statusbar resizes with it (Example1 + 2) !!! how can I prevent this.
2. I have menu-items to show and hide the statusbar. But when I hide it and show it
    again the Statusbar appears on top of Panel1 instead of at the bottom.

Who knows the answer and is willing to help me?

Peter
   


object MainForm: TMainForm
  Left = 0
  Top = 0
  ActiveControl = TreeView1
  Caption = 'TEST'
  ClientHeight = 600
  ClientWidth = 800
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  WindowState = wsMaximized
  PixelsPerInch = 96
  TextHeight = 13
  object Splitter1: TSplitter
    Left = 0
    Top = 437
    Width = 800
    Height = 3
    Cursor = crVSplit
    Align = alBottom
    ExplicitTop = 0
    ExplicitWidth = 440
  end
  object Splitter2: TSplitter
    Left = 200
    Top = 0
    Height = 437
    ExplicitLeft = 400
    ExplicitTop = 264
    ExplicitHeight = 100
  end
  object StatusBar1: TStatusBar
    Left = 0
    Top = 581
    Width = 800
    Height = 19
    Panels = <
      item
        Bevel = pbNone
        Width = 200
      end
      item
        Alignment = taCenter
        Width = 40
      end
      item
        Alignment = taCenter
        Width = 40
      end
      item
        Alignment = taCenter
        Width = 40
      end>
    OnResize = StatusBar1Resize
    ExplicitLeft = 408
    ExplicitTop = 304
    ExplicitWidth = 0
  end
  object Panel1: TPanel
    Left = 0
    Top = 440
    Width = 800
    Height = 141
    Align = alBottom
    BevelOuter = bvNone
    TabOrder = 1
    ExplicitLeft = 288
    ExplicitWidth = 185
    object Panel2: TPanel
      Left = 0
      Top = 0
      Width = 800
      Height = 22
      Align = alTop
      TabOrder = 0
      ExplicitLeft = 312
      ExplicitTop = 48
      ExplicitWidth = 185
      object Label1: TLabel
        AlignWithMargins = True
        Left = 4
        Top = 4
        Width = 77
        Height = 14
        Align = alLeft
        Caption = ' Search Results '
        ExplicitLeft = 368
        ExplicitTop = 0
        ExplicitHeight = 13
      end
    end
    object ListView1: TListView
      Left = 0
      Top = 22
      Width = 800
      Height = 119
      Align = alClient
      Columns = <
        item
          Caption = 'Item Name'
          Width = 200
        end
        item
          Caption = 'Location'
          Width = 250
        end>
      TabOrder = 1
      ViewStyle = vsReport
      ExplicitLeft = 272
      ExplicitTop = -8
      ExplicitWidth = 250
      ExplicitHeight = 150
    end
  end
  object TreeView1: TTreeView
    Left = 0
    Top = 0
    Width = 200
    Height = 437
    Align = alLeft
    HideSelection = False
    Indent = 19
    RowSelect = True
    ShowRoot = False
    TabOrder = 2
  end
  object PageControl1: TPageControl
    AlignWithMargins = True
    Left = 203
    Top = 3
    Width = 597
    Height = 434
    Margins.Left = 0
    Margins.Right = 0
    Margins.Bottom = 0
    Align = alClient
    TabOrder = 3
    ExplicitLeft = 264
    ExplicitTop = 216
    ExplicitWidth = 289
    ExplicitHeight = 193
  end
end

Open in new window

Example1.jpg
Example2.jpg
LVL 1
peterkiersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mahdi78Commented:
try this DFM


object MainForm: TMainForm
  Left = 0
  Top = 0
  ActiveControl = TreeView1
  Caption = 'TEST'
  ClientHeight = 600
  ClientWidth = 800
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  WindowState = wsMaximized
  PixelsPerInch = 96
  TextHeight = 13
  object Splitter1: TSplitter
    Left = 0
    Top = 456
    Width = 800
    Height = 3
    Cursor = crVSplit
    Align = alBottom
    ExplicitTop = 0
    ExplicitWidth = 440
  end
  object Splitter2: TSplitter
    Left = 200
    Top = 0
    Height = 456
    ExplicitLeft = 400
    ExplicitTop = 264
    ExplicitHeight = 100
  end
  object Panel1: TPanel
    Left = 0
    Top = 459
    Width = 800
    Height = 141
    Align = alBottom
    BevelOuter = bvNone
    TabOrder = 0
    ExplicitTop = 440
    object Panel2: TPanel
      Left = 0
      Top = 0
      Width = 800
      Height = 22
      Align = alTop
      TabOrder = 0
      object Label1: TLabel
        AlignWithMargins = True
        Left = 4
        Top = 4
        Width = 77
        Height = 14
        Align = alLeft
        Caption = ' Search Results '
        ExplicitHeight = 13
      end
    end
    object ListView1: TListView
      Left = 0
      Top = 22
      Width = 800
      Height = 100
      Align = alClient
      Columns = <
        item
          Caption = 'Item Name'
          Width = 200
        end
        item
          Caption = 'Location'
          Width = 250
        end>
      TabOrder = 1
      ViewStyle = vsReport
      ExplicitHeight = 91
    end
    object StatusBar1: TStatusBar
      Left = 0
      Top = 122
      Width = 800
      Height = 19
      Panels = <
        item
          Bevel = pbNone
          Width = 200
        end
        item
          Alignment = taCenter
          Width = 40
        end
        item
          Alignment = taCenter
          Width = 40
        end
        item
          Alignment = taCenter
          Width = 40
        end>
    end
  end
  object TreeView1: TTreeView
    Left = 0
    Top = 0
    Width = 200
    Height = 456
    Align = alLeft
    HideSelection = False
    Indent = 19
    RowSelect = True
    ShowRoot = False
    TabOrder = 1
    ExplicitHeight = 437
  end
  object PageControl1: TPageControl
    AlignWithMargins = True
    Left = 203
    Top = 3
    Width = 597
    Height = 453
    Margins.Left = 0
    Margins.Right = 0
    Margins.Bottom = 0
    Align = alClient
    TabOrder = 2
    ExplicitHeight = 434
  end
end

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mahdi78Commented:
Or put statusbar in other panel Panel3 and put the following panel3 property

Panel3.Align = alBottom
Panel3.AutoSize = True
0
peterkiersAuthor Commented:
"try this DFM"

What's the diffirence with mine?

P.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Mahdi78Commented:
change in first DFM was statusbar parent is Panel2 not MainForm,
I found better solution, check my second post
0
peterkiersAuthor Commented:
Oke, I have tried your first solution, and it works for me.
Before I give you the points can I ask you for a litte favor:

I have a menu-item to hide and show the statusbar
but I lost the code for that. Can you please tell me
how to do that again?

p.
0
Mahdi78Commented:
I suggest you to use my second solution

To hide put in height property 1, to show put height property 19

StatusBar1.Height := 1;
StatusBar1.Height := 19;
0
peterkiersAuthor Commented:
Thanx, 500 points are comming you way...

Peter
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.