It seems dx should [really] be (dx/2)? If yoy add the change in form width difference to both tree and grid, it seems the total of the tree and grid width would by twice THISFORM.Width - THISFORM.OldWidth. If dx=(THISFORM.Width - THISFORM.OldWidth)/2, the widths would add [up] to the form width?
>Thanks David,
>
>Any idea why when I changed the beginning width of my grid and treeview in the designer the two controls would stop resizing when the below code is called in the form's resize event? It was all resizing fine until I changed the width value in designer on the grid (wanted to startout with a smaller size when the form is instantiated). Does changing the width of a grid change some other property I'm not aware of?
>
>
>*Form's Resize method
>PRIVATE dx,dy
>
>THISFORM.LockScreen = .T.
>
>dx = THISFORM.Width - THISFORM.OldWidth
>dy = THISFORM.Height - THISFORM.OldHeight
>
>THISFORM.OLETreeView.Width = THISFORM.OLETreeView.Width + dx
>THISFORM.OLETreeView.Height = THISFORM.OLETreeView.Height + dy
>THISFORM.GrdElements.Left = THISFORM.GrdElements.Left + dx
>THISFORM.GrdElements.Left = THISFORM.GrdElements.Left + dx
>THISFORM.GrdElements.Width = THISFORM.GrdElements.Width + dx
>THISFORM.GrdElements.Height = THISFORM.GrdElements.Height + dy
>
>THISFORM.OldWidth = THISFORM.Width
>THISFORM.OldHeight = THISFORM.Height
>
>THISFORM.LockScreen = .F.
>
>
>
>>Tracy,
>>
>>You can use some of the code from the class browser. It has a draggable seperation bar. The source code is in C:\Program
>>Files\VFP8\Tools\xsource\xsource.zip file.
>>
>>Look at the code attached to shpSplitterH and shpSplitterV objects in browser.scx.
>>
>>>However, I would like to add additional functionality. I would like to add the ability for the user to widen (expand) the treeview control if desired (to view all branches left to right) and have the width of the grid narrow respectively just like the windows explorer window (dragging the separator bar left or right widens/narrows each window respectively). Is there anyway to do this? Is there some other control that does this and has the same functionality of what I'm doing with the treeview and grid?
Imagination is more important than knowledge