title: Resizing elements on formResize in delphi
body: <p>I'm currently trying to resize components in my form but i can't figure it out how it works. I've tried OnResize and OnCanResize event but it won't change my component heigh or widht.</p>
  <p>What i did until now is adding like fixed values to my heigh when the user is resizing but it doesn't resize the given component.</p>
  <p>For example:</p>
  <p>In my FormResize even i have something similar to:</p>
  <pre><code>procedure myform.FormResize(Sender TObject);
  var
      width: integer;
  begin
      width := grid.Width +100; //yes it only grows but it doesn't even work
      grid.setBounds(grid.Left,grid.Top,width,grid.height);
  end;
  </code></pre>
  <p>This doesn't work.</p>
  <p>I also tried changing direcly with <code>grid.Width := grid.Width +100</code> but it doesn't work either</p>
  <p>I tried putting the same code in CanResize but same issue. I've tried with break points if it's the right event and if the procedure is being executed when i resize and yes it is. So i guess i missed something. My purpose is to resize the grid to keep the ratio to my form when ever a user resize/maximize the form.</p>
  <p>So what is the proper way to resize a component?</p>
  <p>Thank you.</p>
  <h1>DFM</h1>
  <pre><code>  object BDDTool: TBDDTool
    Left = 0
    Top = 0
    Caption = 'BDD Manager'
    ClientHeight = 303
    ClientWidth = 680
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    Menu = mMainMenu
    OldCreateOrder = False
    Position = poScreenCenter
    OnCloseQuery = FormCloseQuery
    OnCreate = FormCreate
    OnResize = FormResize
    PixelsPerInch = 96
    TextHeight = 13
    object pnlFileManager: TPanel
      Left = 8
      Top = 8
      Width = 665
      Height = 289
      BevelOuter = bvNone
      TabOrder = 0
      object Label1: TLabel
        Left = 156
        Top = 263
        Width = 86
        Height = 13
        Caption = 'Primary key color:'
      end
      object Label2: TLabel
        Left = 364
        Top = 263
        Width = 86
        Height = 13
        Caption = 'Foreign key color:'
      end
      object sgFilePreview: TStringGrid
        Left = 143
        Top = 23
        Width = 514
        Height = 234
        Align = alCustom
        ColCount = 1
        Enabled = False
        FixedCols = 0
        RowCount = 2
        TabOrder = 0
        OnDrawCell = sgFilePreviewDrawCell
        OnMouseDown = sgFilePreviewMouseDown
        ColWidths = (
          64)
        RowHeights = (
          24
          24)
      end
      object btnConnectToDB: TButton
        Left = 0
        Top = 32
        Width = 137
        Height = 25
        Caption = 'Connect to DB'
        Enabled = False
        TabOrder = 1
        OnClick = btnConnectToDBClick
      end
      object btnCreateTabIncK: TButton
        Left = 0
        Top = 94
        Width = 137
        Height = 25
        Caption = 'Create table (inc keys)'
        Enabled = False
        TabOrder = 2
        OnClick = btnCreateTabIncKClick
      end
      object btnCreateTabGuidK: TButton
        Left = 0
        Top = 125
        Width = 137
        Height = 25
        Caption = 'Create table (guid keys)'
        Enabled = False
        TabOrder = 3
      end
      object btnAscFk: TButton
        Left = 0
        Top = 156
        Width = 137
        Height = 25
        Caption = 'Associate foreign keys'
        Enabled = False
        TabOrder = 4
        OnClick = btnAscFkClick
      end
      object pnlFKColor: TPanel
        Left = 456
        Top = 263
        Width = 81
        Height = 18
        TabOrder = 5
      end
      object btnDeconnectDB: TButton
        Left = 0
        Top = 63
        Width = 137
        Height = 25
        Caption = 'Deconnect from DB'
        Enabled = False
        TabOrder = 6
        OnClick = btnDeconnectDBClick
      end
    end
    object pnlPKColor: TPanel
      Left = 256
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  </code></pre>