我倒是没做过,但我看到同事做的项目里用到了窗口的拖放改变两边部分显示比例的做法。他是在窗体上放了一个PICTURE控件,把它缩小为条线(其实我认为直接放个LINE更好),拖放时其实就是在移动PICTURE的位置,然后两部分的大小根据PICTURE的位置来调整。不知道这么说能否帮上你

解决方案 »

  1.   

    这是例子,有两个listview,和两个pictureboxPrivate Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button <> vbLeftButton Then Exit Sub
        picSplitter.Visible = True
        bMove = True
    End SubPrivate Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        On Error Resume Next
        If Button <> vbLeftButton Then Exit Sub
        If bMove = False Then Exit Sub
        picSplitter.Left = imgSplitter.Left + X
    End SubPrivate Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        On Error Resume Next
        If Button <> vbLeftButton Then Exit Sub
        If bMove = False Then Exit Sub
        bMove = False
        picSplitter.Visible = False
        TreeView1.Width = picSplitter.Left
        ListView1.Left = TreeView1.Width + 50
        ListView1.Width = Me.ScaleWidth - ListView1.Left
        imgSplitter.Left = TreeView1.Width
        imgSplitter.Width = ListView1.Left - TreeView1.Width
        imgSplitter.Top = TreeView1.Top
        imgSplitter.Height = TreeView1.Height
        picSplitter.Move imgSplitter.Left, imgSplitter.Top, imgSplitter.Width, imgSplitter.Height
    End Sub