Solved

Splitter

Posted on 1998-08-05
6
332 Views
Last Modified: 2010-05-03
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?
0
Comment
Question by:ndb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 1467961
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
 
LVL 1

Expert Comment

by:batdan
ID: 1467962
Also - Need any extra code?  Check this out:

http://www.mvps.org/vbnet/code/neet/splitterbar.htp
0
 
LVL 1

Expert Comment

by:batdan
ID: 1467963
Sorry:  splitterbar.htm not .htp
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:ndb
ID: 1467964
This doesn't work with an MDI Form.
0
 
LVL 6

Accepted Solution

by:
anthonyc earned 200 total points
ID: 1467965
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
 
LVL 1

Author Comment

by:ndb
ID: 1467966
NicoD@carleton.be
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question