Window.Move
-----------

Moves the window animated.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Window](component_Window.md) | [2.2](newinversion22.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Window.Move"; WindowRef; X; Y { ; NoAnimation; Duration } ) 

**MBS**( **"Window.Move";** /\* Moves the window animated. \*/  
**$WindowRef**; /\* Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window.e.g. 0 \*/   
**$X**; /\* The new X position of the window.e.g. 300 \*/   
**$Y**; /\* The new Y position of the window.e.g. 200 \*/   
**$NoAnimation**; /\* Optional; Whether to avoid animation. Pass 1 to disable animation. Default is 0 to allow animation.e.g. 0 \*/   
**$Duration**) /\* Optional; The duration in seconds. Can be a value between 0.1 and 5.0.e.g. 0.5 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window. | 0 |  |
| X | The new X position of the window. | 300 |  |
| Y | The new Y position of the window. | 200 |  |
| NoAnimation | Whether to avoid animation. Pass 1 to disable animation. Default is 0 to allow animation. | 0 | Optional |
| Duration | The duration in seconds. Can be a value between 0.1 and 5.0. | 0.5 | Optional |

### Result

Returns OK on success.

### Description

Moves the window animated.  
On macOS we use Apples functions for animated move. On Windows we have our own code.   
### Examples

Moves a window:

 MBS ("Window.Move"; $WindowRef ; 300; 200)  
Move window to first screen:

 Set Variable \[ $r ; Value: MBS ( "Window.Move"; Get(WindowName); MBS ( "[Screen.Left](ScreenLeft.md)"; 0 )+20; MBS ( "[Screen.Top](ScreenTop.md)"; 0 )+32) \]  
Move window to second screen:

 Set Variable \[ $r ; Value: MBS ( "Window.Move"; Get(WindowName); MBS ( "[Screen.Left](ScreenLeft.md)"; 1 )+20; MBS ( "[Screen.Top](ScreenTop.md)"; 1 )+32) \]  
### See also

- [Screen.Left](ScreenLeft.md)
- [Screen.Top](ScreenTop.md)
- [Window.Fade](WindowFade.md)
- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)
- [Window.Hide](WindowHide.md)

### Release notes

- **Version 8.4**
    - Fixed bug in [Window.Move](http://www.mbsplugins.eu/WindowMove.shtml) with animation option.

### Example Databases

- [Window/Resize Window Animated](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/Resize%20Window%20Animated.shtml#1GroupButton108.0000000138.0000000134.0000000229.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.4pr1](https://www.mbsplugins.de/archive/2018-08-01/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.4pr6](https://www.mbsplugins.de/archive/2015-11-17/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.7fc](https://www.mbsplugins.de/archive/2012-05-08/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin 2.7 Release notes](https://www.mbsplugins.de/archive/2012-05-08/MBS_Filemaker_Plugin_27_Releas/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.2pr5](https://www.mbsplugins.de/archive/2010-11-30/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 30th December 2023

  
[Window.ModalDialogFront](WindowModalDialogFront.md) - [Window.Parent](WindowParent.md)

[HTML Version](WindowMove.shtml)