Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TreeView and Grid on Form - Tie Together Somehow?
Message
 
To
23/10/2003 12:36:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00841525
Message ID:
00841684
Views:
22
And - to follow David and Jim - a trick I use when form controls are tied to a resize event is call the form's Resize() in the form's init. But it seems you have considered and adressed this:-).

Since you've gone this deep into a tree/grid service - you might just take it a step further - and swap the grid out for listview! No snap-to slider lag and indexes not required for column sorts! The notion of a "SubItemIndex" will have to be visited, but it shouldn't be that much of a challenge:-).

>Ahhh Duhhhh. :o) I knew that ! :o) *G* I changed it playing around to see if it would adjust AT ALL after it stopped resizing. I finally realized that I set the form to maximized when it loads and then of course it was not resizing so the conrols were not resizing either... Sheesh, I'm my own worst enemy sometimes!
>
>
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform