Solved

Splitter

Posted on 1998-08-05
6
327 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now