Window.HasCloseButton
---------------------

You can control whether a Window has a close button or not.

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

MBS( "Window.HasCloseButton"; WindowRef ) 

**MBS**( **"Window.HasCloseButton";** /\* You can control whether a Window has a close button or not. \*/  
**$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 \*/ 

### 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 |

### Description

You can control whether a Window has a close button or not.   
This function returns the current state of the window's close button.  
### Examples

State of the Window Close Button

 Let(  
\[  
windowRef = MBS ("[Window.FindByTitle](WindowFindByTitle.md)"; Get(WindowName))  
\];  
  
  
GetAsBoolean(  
MBS (  
"Window.HasCloseButton";  
WindowRef  
) = "true"  
)  
)  
### See also

- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)
- [Window.HasZoomButton](WindowHasZoomButton.md)
- [Window.SetCloseButton](WindowSetCloseButton.md)

### Example Databases

- [Window/WindowEffects](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/WindowEffects.shtml#1297FieldAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 28th November 2019

  
[Window.GetWindowDisplayAffinity](WindowGetWindowDisplayAffinity.md) - [Window.HasFormattingBar](WindowHasFormattingBar.md)

[HTML Version](WindowHasCloseButton.shtml)