像vb自己的工具栏的窗体怎么做啊!好象它可以随便拖放的?同时也可以成为mdi窗体,也可以在菜单栏下面

解决方案 »

  1.   

    在窗口中加入三个控件:treeview1,image(取名imgSplitter),listview以下提供范例。
    Option ExplicitPrivate Sub Form_Load()
        With TreeView1
            .Top = 15
            .Left = 15
            .Height = Me.Height - StatusBar1.Height - 400
            .Width = Me.Width * 0.35
        End With
        With imgSplitter
            .Top = 15
            .Left = TreeView1.Left + TreeView1.Width
            .Height = TreeView1.Height
            .Width = 60
        End With
        With ListView1
            .Top = 15
            .Left = TreeView1.Left + TreeView1.Width + imgSplitter.Width
            .Height = TreeView1.Height
            .Width = Me.Width * 0.65 - 200
        End With
    End SubPrivate Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        '开始移动
        If Button = 1 Then
            If X < 0 Then       '向左平移
                If Abs(X) >= TreeView1.Width - 60 Then
                    ListView1.Width = TreeView1.Width + imgSplitter.Width + ListView1.Width - 120
                    TreeView1.Width = 60
                    imgSplitter.Left = 60
                    ListView1.Left = 120
                Else
                    TreeView1.Width = TreeView1.Width + X
                    imgSplitter.Left = imgSplitter.Left + X
                    ListView1.Left = ListView1.Left + X
                    ListView1.Width = ListView1.Width - X
                End If
            ElseIf X > 0 Then   '向右平移
                If X >= ListView1.Width - 180 Then
                    TreeView1.Width = TreeView1.Width + imgSplitter.Width + ListView1.Width - 180
                    imgSplitter.Left = TreeView1.Left + TreeView1.Width
                    ListView1.Left = imgSplitter.Left + imgSplitter.Width
                    ListView1.Width = 120
                Else
                    TreeView1.Width = TreeView1.Width + X
                    imgSplitter.Left = imgSplitter.Left + X
                    ListView1.Left = ListView1.Left + X
                    ListView1.Width = ListView1.Width - X
                End If
            End If
        End If
    End Sub'这里只是举例,要运用还得自己去理解。 
      

  2.   

    到WWW.DATADYMICS.COM去下载一个activebar 控件,什么问题都解决了!