Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Mahdi78
Mahdi78
Flag of Algeria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or put statusbar in other panel Panel3 and put the following panel3 property

Panel3.Align = alBottom
Panel3.AutoSize = True
Avatar of Peter Kiers

ASKER

"try this DFM"

What's the diffirence with mine?

P.
change in first DFM was statusbar parent is Panel2 not MainForm,
I found better solution, check my second post
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.
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;
Thanx, 500 points are comming you way...

Peter