Occurs before docking a ToolBar object or a Form object, for example, when dragging a toolbar or form to a docking area or calling the Dock method.
PROCEDURE Object.BeforeDock LPARAMETERS nLocation
Returns the docking position for the toolbar or form.
The following table lists the values for nLocation.
nLocation Description FoxPro.h constant
Form or toolbar will undock.
Form or toolbar will dock at the top of main Visual FoxPro window.
Form or toolbar will dock to the left edge of the main Visual FoxPro window.
Form or toolbar will dock to the right edge of the main Visual FoxPro window.
Form or toolbar will dock at the bottom edge of the Visual FoxPro window.
Form will tab dock to another form.
Form will link dock to another form.
Note: To determine additional information for the target and position, you need to call the GetDockState method after the docking operation completes. For more information, see GetDockState Method.
BeforeDock occurs before Visual FoxPro redraws the form or toolbar so you can change the appearance of the form or toolbar. For example, suppose you want to replace a ComboBox control on the form with a CommandButton control, which has different proportions. You can insert code into the BeforeDock event that replaces the control when docking the form.
Returning .F. (False) from code in the event or adding the NODEFAULT command does not prevent docking. For more information, see NODEFAULT Command.