Results 1 to 15 of 15

Thread: Resizable Frames

  1. #1

    Thread Starter
    Lively Member Rockman's Avatar
    Join Date
    Apr 2001
    Posts
    66

    Resizable Frames

    Is there a VB 6.0 control that gives you resizable frames? I know there is a "frame" container in VB, but the type of framing I'm talking about is the kind that Outlook Express utilizes.

    (I tried searching this site for an answer but "frames" turned up hundreds of references that didn't apply, and "resizable frames" turned up 1 instance that was not helpful)

    Thanks for any help,
    Jeff

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I don't understand what you mean by resizable frames?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    I guess he means a frame which is resizable in run-time. But I don't see where it's used in Outlook Express.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4

    Thread Starter
    Lively Member Rockman's Avatar
    Join Date
    Apr 2001
    Posts
    66
    The "frames" I'm referring to are the "sub-sections" of the main window. In Outlook Express you have a frame that contains "Folder" names, a frame that contains a list of the e-mails you've received, etc... These frames are end-user resizable and a very useful GUI tool. I can't seem to find anything equivolent in Visual Basic.

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Those are not frames... are ListBox and or TreeView (or similar controls)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Maybe this is what you're needing



    Check the samples over here
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7

    Thread Starter
    Lively Member Rockman's Avatar
    Join Date
    Apr 2001
    Posts
    66
    Mc Brain, thanks for the tip on the S-Grid but that is not the issue I'm trying to pursue here.

    You are correct to state that the individual controls in Outlook Express are a ListBox and/or TreeView, but these controls occupy the window in different "frames"... such that between them there is a spine. When the cursor moves over the spine the cursor changes to a double-ended arrow and the user can resize these "frames". Perhaps a better term than "frame" would be a "pane"... in keeping with the "windows" analogy.

    Thanks for the help.

  8. #8
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Ok.... and you've said the answer and didn't even realize.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    You have to add a picturebox (between them) and resize the object on the MouseMove of the picturebox.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  10. #10

    Thread Starter
    Lively Member Rockman's Avatar
    Join Date
    Apr 2001
    Posts
    66
    Interesting... I will go now and try to implement that... Thanks so much for the help!

    Jeff

  11. #11
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Maybe this helps:

    VB Code:
    1. Private Moving As Boolean
    2. Public PosX As Long
    3.  
    4.  
    5. Private Sub Separator_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    6.     Moving = True
    7. End Sub
    8.  
    9. Private Sub Separator_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    10.     If Moving Then
    11.         PosX = Separator.Left + x
    12.         If PosX < 0 Then PosX = 0
    13.         If PosX > ScaleWidth Then PosX = ScaleWidth - Separator.Width
    14.         Moving = False
    15.         ReDrawSeparator
    16.         Moving = True
    17.     End If
    18. End Sub
    19.  
    20. Private Sub Separator_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    21.     Moving = False
    22. End Sub
    23.  
    24. Private Sub ReDrawSeparator()
    25.     Dim fHeight As Single
    26.     Dim TopPos As Single
    27.    
    28.     If Me.WindowState = vbMinimized Then Exit Sub
    29.     TopPos = -TBAddress.Visible * (TBAddress.Height - 60)
    30.     TBAddress.Top = TopPos - TBAddress.Height
    31.     fHeight = Me.Height - TopPos - TV.Top - 200
    32.    
    33.     TV.Move 0, TopPos + 100, PosX, fHeight
    34.     Separator.Move PosX, TopPos + 100, ScaleX(3, vbPixels, vbTwips), fHeight
    35.     LV.Move PosX + Separator.Width, TopPos - 10, ScaleWidth - LV.Left, fHeight + 30
    36.     'Don't know why.. but the second time sizes the LV correctly
    37.     LV.Move PosX + Separator.Width, TopPos + 90, ScaleWidth - LV.Left, fHeight + 30
    38.    
    39.     TBAddress.Move 30, TBAddress.Top, ScaleWidth - 150
    40.     WEPath.Width = TBAddress.Width - WEPath.Left - 60
    41.     DoEvents
    42.    
    43. End Sub
    Last edited by Mc Brain; Jan 11th, 2002 at 07:22 PM.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  12. #12
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Some things to know:

    Separator is the picturebox between the ListView (LV) and the TreeView (TV).

    TBAddress is a Frame that contains a Label (WEPath.Width) -which shows the address of the folder I was seeing-

    Remember to set the property of the cursor to your picturebox, so that it show the double-ended arrow.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  13. #13
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Just in case you need more help..... Here's done!
    Attached Files Attached Files
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  14. #14

    Thread Starter
    Lively Member Rockman's Avatar
    Join Date
    Apr 2001
    Posts
    66
    Thanks again Mc Brain. I futzed with the code you provided and came up with this:

    Code:
    Option Explicit
    Dim fSpineOffset As Single  'The initial offset of the click on the spine.
        
    Private Sub Form_Load()
      'Because drawing the perfect panes in design mode is not easy,
      'run the AdjustVPane routine once.  Use 0 to keep the spine in
      'the position set at design time.
      AdjustVPane 0
    
    End Sub
    
    Private Sub pctSpine_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
      'When the spine is initially clicked, get the X value as the offset.
      'This insures that (even on fat spines) the spine doesn't jump quickly
      'to one side or the other.
      fSpineOffset = X
    
    End Sub
    
    Private Sub pctSpine_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
      'If the left button is down, adjust the vertical pane.
      If Button = 1 Then AdjustVPane X
    
    End Sub
    
    Private Sub AdjustVPane(fScaleX As Single)
    Dim fPosX As Single  'The absolute X position of the mouse on the form.
    Const iMinRPaneSize = 175  'The minimum size of the right pane
    Const iMinLPaneSize = 175  'The minimum size of the left pane
      'Finds the absolute X position, tests for boundaries, then draws
      'spine, left text box (txtLeft), and the right text box (txtRight).
      fPosX = pctSpine.Left + fScaleX - fSpineOffset
      If fPosX < txtLeft.Left + iMinLPaneSize Then
        fPosX = txtLeft.Left + iMinLPaneSize
      ElseIf fPosX > (txtRight.Left + txtRight.Width) - (pctSpine.Width + iMinRPaneSize) Then
        fPosX = (txtRight.Left + txtRight.Width) - (pctSpine.Width + iMinRPaneSize)
      End If
      pctSpine.Left = fPosX
      txtLeft.Width = fPosX - txtLeft.Left
      txtRight.Width = (txtRight.Left + txtRight.Width) - (fPosX + pctSpine.Width)
      txtRight.Left = fPosX + pctSpine.Width
      
    End Sub
    Once again this forum proves to be awesome. Thanks all for participating.

  15. #15
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Alright! Great you got it working!!
    You're welcome
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width