Condividi tramite


Dock Method

Positions a ToolBar or Form object along a border of the main Visual FoxPro window or positions a Form object within Visual FoxPro IDE windows or with other forms. To use the Dock method for forms, the form's Dockable property must be set to 1. There are two versions of the syntax.

Toolbar.Dock(nLocation [, X, Y])
Form.Dock(nLocation, [, oForm])

Parameters

  • nLocation
    Specifies the location to dock the toolbar or form.

    The following table lists the values for nLocation.

    nLocation

    Description

    FoxPro.h constant

    –1

    Undocks the toolbar or form.

    TOOL_NOTDOCKED

    0

    Positions the toolbar or form at the top of the main Visual FoxPro window.

    TOOL_TOP

    1

    Positions the toolbar or form at the left side of the main Visual FoxPro window.

    TOOL_LEFT

    2

    Positions the toolbar or form at the right side of the main Visual FoxPro window.

    TOOL_RIGHT

    3

    Positions the toolbar or form at the bottom of the main Visual FoxPro window.

    TOOL_BOTTOM

    4

    Tab docks a form with another window. (Forms only)

    TOOL_TAB

  • X, Y
    Specifies the horizontal and vertical coordinates respectively for the toolbar docking position.

  • oForm
    Specifies an object reference to another form for tab or link docking.

Return Value

Logical data type. Dock returns True (.T.) if the item successfully docks. Otherwise, Dock returns False (.F.).

Remarks

Applies To: Form Object | ToolBar Object

Visual FoxPro does not support docking for top-level forms. Therefore, Visual FoxPro disregards a docked form's ShowWindow property, which determines whether a form is a top-level form and always defaults the property's value to 0.

When calling the Dock method, the Activate and Resize events occur.

You cannot dock items recursively. For example, you cannot dock one form while docking another.

For more information about docking toolbars and forms, see How to: Dock Toolbars and How to: Dock Forms.

Example

The following example uses the CREATEOBJECT( ) function to create a form, sets the Dockable and Visible properties so that the form is dockable and visible, and uses the Dock method to dock the form to the left side of the main Visual FoxPro window.

omyForm = CREATEOBJECT("Form")
omyForm.Dockable = 1
omyForm.Visible = .T.
omyForm.Dock(1)

See Also

Reference

Dockable Property

GetDockState Method

AfterDock Event

BeforeDock Event

Docked Property

UnDock Event

ADOCKSTATE( ) Function

Other Resources

Methods (Visual FoxPro)

Language Reference (Visual FoxPro)