# Function Reference

# ControlMove

Moves a control within a window.

ControlMove ( "title", "text", controlID, x, y [, width [, height]] )

## Parameters

title | The title/hWnd/class of the window to access. See Title special definition.
text | The text of the window to access. See Text special definition.
controlID | The control to interact with. See Controls.
x | X coordinate to move to relative to the window client area.
y | Y coordinate to move to relative to the window client area.
width | [optional] New width of the window.
height | [optional] New height of the window.

## Return Value

Success: | 1.
Failure: | 0 if window/control is not found.

## Remarks

If x and y equal to the Default keyword no move occurs, just resizing.

## Related

ControlCommand, ControlGetPos

## Example

    Example()

    Func Example()
        ; Run Notepad
        Run("notepad.exe")

        Local $hWnd = WinWaitActive("[CLASS:Notepad]", "")

        ; Wait for 2 seconds.
        Sleep(2000)

        ; Move the edit control of Notepad using the handle returned by WinWaitActive.
        ControlMove($hWnd, "", ControlGetFocus($hWnd), 0, 75, 150, 150)

        ; Wait for 2 seconds.
        Sleep(2000)

        ControlMove($hWnd, "", ControlGetFocus($hWnd), 0, 175, 100, 100)

        ; Wait for 2 seconds.
        Sleep(2000)

        ; Close the Notepad window using the handle returned by WinWait.
        WinClose($hWnd)
    EndFunc   ;==>Example