Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TreeView and Grid on Form - Tie Together Somehow?
Message
From
23/10/2003 12:17:45
 
 
To
23/10/2003 11:04:39
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00841525
Message ID:
00841639
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
I think David gave you the probable answer, but it might be interesting to know the 'why'...

I **think** that once you change any form's (or control's??) dimensions from "default" then the Resize runs at STARTUP too. Probably before your oldxxx values have been set.

cheers



>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform