Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Explorer Type Window
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00276394
Message ID:
00277136
Views:
19
>I'm trying to create a form that has the look and feel of the Windows file explorer, with the TreeView on the left, ListView on the right, and a splitter bar between them. The trouble I'm having is what is the splitter bar control? I cannot get it to be shown above the TreeView or ListView controls?

Hey Joseph,

This is pretty easy to do. Use a shape baseclass and set the DragMode property to "1 - Automatic Drag". Place the shape object on your form as a "slider". Place code in the resize of the shape object so it resizes to fit the form.

In the DragDrop methods of your TreeView and ListView place the following:

LPARAMETERS oSource, nXCoord, nYCoord
IF oSource.Name = "slider"
THISFORM.DragDrop(oSource, (THIS.Left + nXCoord), nYCoord)
ENDIF

The nXCoord will be relative to the object the oSource is dropped on so in order to position the properly on a form you need to pass the position of the object plus the position the of the slider. The code in your form should be as follows:

LPARAMETERS oSource, nXCoord, nYCoord
oSource.Left = nXCoord
THIS.RepositionObjects()

The RepositionObjects method should be something similar to below:

THIS.Slider.Resize()
IF VARTYPE(THIS.TreeView)='O'
THIS.TreeView.Left = 2
THIS.TreeView.Top = 2
THIS.TreeView.Width = This.Slider.Left - (THIS.TreeView.Left + 2)
THIS.TreeView.Height = THIS.Height - (This.Top + 2)
ENDIF
IF VARTYPE(THIS.ListView)='O'
THIS.ListView.Left = This.Slider.Left + THIS.Slider.Width + 2
THIS.ListView.Top = 2
THIS.ListView.Width = THIS.Width - (THIS.ListView.Left + 2)
THIS.ListView.Height = THIS.Height - (THIS.ListView.Top + 1)
ENDIF

That should get you started.

Bill
Heavy Metal Pedal - click with care
Previous
Reply
Map
View

Click here to load this message in the networking platform