在VB6.0窗体中,如何设计成上下两部分的布局,如下图所示
 _____________
|             |
|             |
|             |
|             |
|_____________|
|             |
|             |
|_____________|通过中间的横线可以自由调节这两个区域的上下高度?请指教!

解决方案 »

  1.   

    用几个picture加十分复杂的判断可以办到,俺弄过,好像有控件吧。
      

  2.   

    上下各用一个PictureBox或Fram 当容器, 中间那条线用PictureBox, 使用PictureMove的三个Mouse事件上下拖动, 上下两个容器即可一大一下或一小一大啦..........
      

  3.   

    我以前写过一个有bug的分割类,你拿去改改好了http://econet.zjgsu.edu.cn/cy_filesxxx/vbsrc/Spliter.rar
      

  4.   

    上网找一个控件叫 SSSpliter
      

  5.   

    编写代码的窗口本来就有这个功能,跟Excel工作薄一样的!在纵向滚动条上面有一个横杠,你注意看一下,鼠标移动到上面之后鼠标形状会改变为上下箭头,这时只要往下拉就可以了!不知道楼主要的是不是这效果!
      

  6.   

    噢,我看错了楼主的意思了~sorry~
    当我没说过!
      

  7.   

    Option ExplicitPrivate Const AsyncMove As Boolean = False      '实时移动控制Dim mY As Long, AllHei As LongPrivate Sub Form_Load()
        AllHei = Picture2.Top + Picture2.Height         '把大小极限先记录一下
    End SubPrivate Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        mY = Y          '鼠标按下时的鼠标坐标
    End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button And vbLeftButton Then
            Dim tmpTop As Long
            
            With Label1
                tmpTop = .Top + Y - mY      '计算应该移动到的坐标
                
                If tmpTop <= Picture1.Top Then tmpTop = Picture1.Top        '数值合法化
                If tmpTop >= AllHei - .Height Then tmpTop = AllHei - .Height
                
                .Move .Left, tmpTop             '先移动"分割条"
                
                If AsyncMove = False Then
                    Picture1.Height = .Top - Picture1.Top       '再移动各控件
                    Picture2.Top = .Top + .Height
                    Picture2.Height = AllHei - Picture2.Top
                End If
            End With
        End If
    End SubPrivate Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If AsyncMove = True Then
            With Label1
                Picture1.Height = .Top - Picture1.Top       '再移动各控件
                Picture2.Top = .Top + .Height
                Picture2.Height = AllHei - Picture2.Top
            End With
        End If
    End Sub代码大约就是这样.添加一个LABEL,两个PICTUREBOX...
      

  8.   

    mouse事件大概代码(没有加越界判断)其中 Picture1为上窗体,Picture2为下窗体,Picture3为上下窗体中间的
    拖动条。lable1为判断鼠标是否在Picture3上按下
    Private Sub Picture3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Label1.Caption = 1
    End SubPrivate Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Label1.Caption = "1" Then
            Picture3.Top = Picture3.Top + Y
            Picture1.Height = Picture1.Height + Y
            Picture2.Top = Picture2.Top + Y
            Picture2.Height = Picture2.Height - Y
        End If
        
        
    End SubPrivate Sub Picture3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Picture3.Top = Picture3.Top + Y
        Label1.Caption = 0
    End Sub
      

  9.   

    干脆打个包,免得以后要用时再花细胞去想.http://www.m5home.com/blog/article.asp?id=88是个完整工程....