Form management

I try to design multiple form (2 forms) within a single mdi. it look like VB editor layout which is there is a properties window and project explorer window within a single mdi.

i know how to load both mdi child into mdi parent. but what i don't know is to merge both mdi child and make it split by something splitter (just like vb editor layout).
Who is Participating?

Improve company productivity with a Business Account.Sign Up

MicrosoftConnect With a Mentor Commented:

'variable to hold the width of the splitter bar
 Private Const SPLT_WDTH As Integer = 20

'variable to hold the last-sized position
 Private currSplitPosX As Long

'variable to hold the horizontal
'and vertical offsets of the 2 controls
 Dim CTRL_OFFSET As Integer

'variable to hold the Splitter bar colour

Private Sub Form_Load()

  Dim msg As String    

 'set the startup variables

 'set the current splitter bar position to an
 'arbitrary value that will always be outside
 'the possible range.  This allows us to check
 'for movement of the splitter bar in subsequent
 'mousexxx subs.
  currSplitPosX = &H7FFFFFFF
  ListLeft.AddItem "Left list Item 1"
  ListLeft.AddItem "Left list Item 2"
  ListLeft.AddItem "Left list Item 3"
  ListLeft.AddItem "Left list Item 4"
  ListLeft.AddItem "Left list Item 5"

  msg = msg & "This code demonstrates how to "
  msg = msg & "implement a splitter bar in a "
  msg = msg & "Visual Basic Project." & vbCrLf & vbCrLf
  msg = msg & "It's actions are controlled through "
  msg = msg & "the MouseDown, MouseMove and MouseUp "
  msg = msg & "subs of the Splitter PictureBox, and "
  msg = msg & "the Resize event of the form."
  TextRight.Text = msg
 'assure that the splitter will appear over the controls
  Splitter.ZOrder 0
End Sub

Private Sub mnuEnd_Click()
   Unload Me

End Sub

Private Sub splitter_MouseMove(Button As Integer, _
                               Shift As Integer, _
                               x As Single, y As Single)
  'change the icon to a left-right sizing icon  
   Splitter.MousePointer = 9
   If Button = vbLeftButton Then
 'if the splitter has been moved...
      If currSplitPosX <> &H7FFFFFFF Then
        'if the current position <> default, reposition
        'the splitter and set this as the current value
         If CLng(x) <> currSplitPosX Then
            Splitter.Move Splitter.Left + x, _
                          CTRL_OFFSET, SPLT_WDTH, _
                          ScaleHeight - (CTRL_OFFSET * 2)
           currSplitPosX = CLng(x)
         End If
      End If  'If currSplitPosX
   End If  'If Button

End Sub

Private Sub splitter_MouseUp(Button As Integer, _
                             Shift As Integer, _
                             x As Single, y As Single)
 'if the splitter has been moved...
  If currSplitPosX <> &H7FFFFFFF Then
     'if the current position <> the last
     'position do a final move of the splitter
      If CLng(x) <> currSplitPosX Then
        Splitter.Move Splitter.Left + x, _
                     CTRL_OFFSET, SPLT_WDTH, _
                     ScaleHeight - (CTRL_OFFSET * 2)
      End If
     'call this the default position
      currSplitPosX = &H7FFFFFFF
     'restore the normal splitter colour
      Splitter.BackColor = &H8000000F
     'and check for valid sizing.
     'Either enforce the default minimum & maximum widths for
     'the left list, or, if within range, set the width
      If Splitter.Left > 60 And Splitter.Left < (ScaleWidth - 60) Then
            'the pane is within range
             ListLeft.Width = Splitter.Left - ListLeft.Left  
      ElseIf Splitter.Left < 60 Then          
            'the pane is too small
             ListLeft.Width = 60
      Else: 'the pane is too wide
             ListLeft.Width = ScaleWidth - 60  
      End If
     'reset the cursor
      Splitter.MousePointer = 0  
     'reposition both lists, and the splitter bar
  End If
End Sub

Private Sub splitter_MouseDown(Button As Integer, _
                               Shift As Integer, _
                               x As Single, y As Single)
    If Button = vbLeftButton Then
       'change the splitter colour
        Splitter.BackColor = SPLT_COLOUR
       'set the current position to x
        currSplitPosX = CLng(x)
       'not the left button, so...
       'if the current position <> default, cause a MouseUp
        If currSplitPosX <> &H7FFFFFFF Then
           splitter_MouseUp Button, Shift, x, y
        End If
       'set the current position to the default value
        currSplitPosX = &H7FFFFFFF
    End If
End Sub

Private Sub Form_Resize()
  Dim x1 As Integer
  Dim x2 As Integer
  Dim height1 As Integer
  Dim width1 As Integer
  Dim width2 As Integer
  On Error Resume Next

 'set the height of the controls
  height1 = ScaleHeight - (CTRL_OFFSET * 2)
  width1 = ListLeft.Width
  x2 = x1 + ListLeft.Width + SPLT_WDTH - 1
  width2 = ScaleWidth - x2 - CTRL_OFFSET
 'move the left list
  ListLeft.Move x1 - 1, CTRL_OFFSET, width1, height1
 'move the right list
  TextRight.Move x2, CTRL_OFFSET, width2 + 1, height1
 'reposition the splitter bar
  Splitter.Move x1 + ListLeft.Width - 1, _
               CTRL_OFFSET, SPLT_WDTH, height1
End Sub
azsoftAuthor Commented:
as you said we use splitter to split the thing. But i still don't get how we want to merge 2 form (within mdi) and between them is a splitter which is we can drag with mouse down.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link 
POINTS FOR EXPERTS awaiting comments are listed in the link below
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange
Moderator, my recommended disposition is:

    Accept Microsoft's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

E-E Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.