Share via


BeforeDock Event

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

Parameters

  • nLocation
    Returns the docking position for the toolbar or form.

    The following table lists the values for nLocation.

    nLocation

    Description

    FoxPro.h constant

    -1

    Form or toolbar will undock.

    TOOL_NOTDOCKED

    0

    Form or toolbar will dock at the top of main Visual FoxPro window.

    TOOL_TOP

    1

    Form or toolbar will dock to the left edge of the main Visual FoxPro window.

    TOOL_LEFT

    2

    Form or toolbar will dock to the right edge of the main Visual FoxPro window.

    TOOL_RIGHT

    3

    Form or toolbar will dock at the bottom edge of the Visual FoxPro window.

    TOOL_BOTTOM

    4

    Form will tab dock to another form.

    TOOL_TAB

    5

    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.

    TOOL_LINK

    Remarks

    Applies To: Form Object | ToolBar Object

    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.

    See Also

    Tasks

    How to: Dock Forms

    How to: Dock Toolbars

    Reference

    ADOCKSTATE( ) Function

    AfterDock Event

    Dock Method

    Dockable Property

    Docked Property

    DockPosition Property

    GetDockState Method

    UnDock Event

    Other Resources

    Events (Visual FoxPro)

    Language Reference (Visual FoxPro)