Splitter

I have a MDI form. On the left of it I have a picturebox that serves as toolbar. On the right side I have several Childforms.
How can I make a splitter to size my toolbar as in VB5?
LVL 1
ndbAsked:
Who is Participating?
 
anthonycConnect With a Mentor Commented:
sure it does... You can not use a FRAME you replace the frame with a picture box.  Give me your email address, and I'll show you.

Anthony
0
 
anthonycCommented:
ok this is pretty easy to do:

I've implemented it with a frame, but that will not work on an MDI form.  Use a picturebox.... it'll still work.  Here is the source I used for the frame:

private m_bMoving as boolean
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long

Private Sub fraSplit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button And vbLeftButton Then
        SetCapture fraSplit.hwnd
        m_bMoving = True
    End If
End Sub

Private Sub fraSplit_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Static bWorking As Boolean
   
    If Not bWorking Then
        bWorking = True
        With fraSplit
            If m_bMoving Then
                .left = .Left + X
            End If
        End With
        bWorking = False
    End If
End Sub

Private Sub fraSplit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If m_bMoving Then
        ReleaseCapture
    End If
    m_bMoving = False
End Sub

0
 
batdanCommented:
Also - Need any extra code?  Check this out:

http://www.mvps.org/vbnet/code/neet/splitterbar.htp
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
batdanCommented:
Sorry:  splitterbar.htm not .htp
0
 
ndbAuthor Commented:
This doesn't work with an MDI Form.
0
 
ndbAuthor Commented:
NicoD@carleton.be
0
All Courses

From novice to tech pro — start learning today.