|
-
Jan 11th, 2002, 05:36 PM
#1
Thread Starter
Lively Member
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
-
Jan 11th, 2002, 05:50 PM
#2
Stuck in the 80s
I don't understand what you mean by resizable frames?
-
Jan 11th, 2002, 06:02 PM
#3
-
Jan 11th, 2002, 06:32 PM
#4
Thread Starter
Lively Member
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.
-
Jan 11th, 2002, 06:33 PM
#5
-
Jan 11th, 2002, 06:37 PM
#6
Need-a-life Member
-
Jan 11th, 2002, 06:58 PM
#7
Thread Starter
Lively Member
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.
-
Jan 11th, 2002, 07:00 PM
#8
-
Jan 11th, 2002, 07:01 PM
#9
-
Jan 11th, 2002, 07:07 PM
#10
Thread Starter
Lively Member
Interesting... I will go now and try to implement that... Thanks so much for the help!
Jeff
-
Jan 11th, 2002, 07:12 PM
#11
Need-a-life Member
Maybe this helps:
VB Code:
Private Moving As Boolean
Public PosX As Long
Private Sub Separator_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Moving = True
End Sub
Private Sub Separator_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Moving Then
PosX = Separator.Left + x
If PosX < 0 Then PosX = 0
If PosX > ScaleWidth Then PosX = ScaleWidth - Separator.Width
Moving = False
ReDrawSeparator
Moving = True
End If
End Sub
Private Sub Separator_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Moving = False
End Sub
Private Sub ReDrawSeparator()
Dim fHeight As Single
Dim TopPos As Single
If Me.WindowState = vbMinimized Then Exit Sub
TopPos = -TBAddress.Visible * (TBAddress.Height - 60)
TBAddress.Top = TopPos - TBAddress.Height
fHeight = Me.Height - TopPos - TV.Top - 200
TV.Move 0, TopPos + 100, PosX, fHeight
Separator.Move PosX, TopPos + 100, ScaleX(3, vbPixels, vbTwips), fHeight
LV.Move PosX + Separator.Width, TopPos - 10, ScaleWidth - LV.Left, fHeight + 30
'Don't know why.. but the second time sizes the LV correctly
LV.Move PosX + Separator.Width, TopPos + 90, ScaleWidth - LV.Left, fHeight + 30
TBAddress.Move 30, TBAddress.Top, ScaleWidth - 150
WEPath.Width = TBAddress.Width - WEPath.Left - 60
DoEvents
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.
-
Jan 11th, 2002, 07:18 PM
#12
-
Jan 11th, 2002, 07:27 PM
#13
Need-a-life Member
-
Jan 16th, 2002, 01:03 AM
#14
Thread Starter
Lively Member
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.
-
Jan 16th, 2002, 02:33 AM
#15
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|