Solved

Form management

Posted on 2001-06-07
6
177 Views
Last Modified: 2010-05-02
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).
0
Comment
Question by:azsoft
6 Comments
 
LVL 2

Accepted Solution

by:
Microsoft earned 50 total points
ID: 6164465
0
 
LVL 2

Expert Comment

by:Microsoft
ID: 6164493
OR TRY THIS :-

'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
 Dim SPLT_COLOUR As Long

Private Sub Form_Load()

  Dim msg As String    

 'set the startup variables
  CTRL_OFFSET = 20
  SPLT_COLOUR = vbRed

 '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
      Form_Resize
 
  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)
   
    Else
   
       '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)
 
  x1 = CTRL_OFFSET
  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
0
 

Author Comment

by:azsoft
ID: 6182169
microsoft,
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.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Expert Comment

by:Moondancer
ID: 6979334
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.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

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.
http://www.experts-exchange.com/questions/Q.20107188.html
http://www.experts-exchange.com/questions/Q.20131426.html
http://www.experts-exchange.com/questions/Q.20134727.html
http://www.experts-exchange.com/questions/Q.20141831.html
http://www.experts-exchange.com/questions/Q.20145275.html
http://www.experts-exchange.com/questions/Q.20145277.html
http://www.experts-exchange.com/questions/Q.20196746.html
http://www.experts-exchange.com/questions/Q.20249690.html
http://www.experts-exchange.com/questions/Q.20255224.html
http://www.experts-exchange.com/questions/Q.20287293.html
http://www.experts-exchange.com/questions/Q.20287915.html
http://www.experts-exchange.com/questions/Q.20292953.html
http://www.experts-exchange.com/questions/Q.20293816.html

To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20187315.html

*****  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
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
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.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7133416
Moderator, my recommended disposition is:

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

DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7167810
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

15 Experts available now in Live!

Get 1:1 Help Now