怎么作才能作到把一个窗体分成两部分。并且能随意拖动这两部分的大小,就是说拖动窗体中间的那条线,那么窗体的两部分随着手动而改变大小,但总窗体的大小是没有变。
   我不知道在那个事件下,用什么控件写。谢谢

解决方案 »

  1.   

    新建一空白窗体
    上面放两个Panel
    设置Panel1的Align属性为alLeft
    再放一个TSplitter
    把另一个Panel2的Align属性高为alClientOK
      

  2.   

    这是完整的dfm,你看看吧object Form1: TForm1
      Left = 258
      Top = 161
      Width = 696
      Height = 480
      Caption = 'Form1'
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object Splitter1: TSplitter
        Left = 185
        Top = 0
        Width = 100
        Height = 446
        Cursor = crHSplit
      end
      object Panel1: TPanel
        Left = 0
        Top = 0
        Width = 185
        Height = 446
        Align = alLeft
        Caption = 'Panel1'
        TabOrder = 0
      end
      object Panel2: TPanel
        Left = 285
        Top = 0
        Width = 403
        Height = 446
        Align = alClient
        Caption = 'Panel2'
        TabOrder = 1
        object Button1: TButton
          Left = 104
          Top = 128
          Width = 75
          Height = 25
          Caption = 'Button1'
          TabOrder = 0
          OnClick = Button1Click
        end
      end
    end