Window.SetTopMost
-----------------

Sets window to be topmost.

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

MBS( "Window.SetTopMost"; WindowRef; Value ) 

**MBS**( **"Window.SetTopMost";** /\* Sets window to be topmost. \*/  
**$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 \*/   
**$Value**) /\* The new topmost setting. Can be 0 or 1.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| 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 |
| Value | The new topmost setting. Can be 0 or 1. | 1 |

### Result

Returns OK or error.

### Description

Sets window to be topmost.  
If window is topmost, it floats over all other windows, like always on top.  
### Examples

Disable topmost for current window:

 MBS ( "Window.SetTopMost"; 0; 0 )  
### See also

- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)
- [Window.GetTopMost](WindowGetTopMost.md)

### Example Databases

- [Window/Window TopMost](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/Window%20TopMost.shtml#1GroupButton192.000000096.0000000217.0000000193.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS Filemaker Plugin, version 4.2pr5](https://www.mbsplugins.de/archive/2014-05-10/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 15th April 2024

  
[Window.SetToolbarVisible](WindowSetToolbarVisible.md) - [Window.SetWindowDisplayAffinity](WindowSetWindowDisplayAffinity.md)

[HTML Version](WindowSetTopMost.shtml)