Preview.SetFocus
----------------

Sets focus to the view.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Preview](component_Preview.md) | [13.5](newinversion135.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Preview.SetFocus"; PreviewRef ) 

**MBS**( **"Preview.SetFocus";** /\* Sets focus to the view. \*/  
**$PreviewRef**) /\* The reference ID for this preview control.e.g. $ref \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PreviewRef | The reference ID for this preview control. | $ref |

### Result

Returns OK or error.

### Description

Sets focus to the view.  
This happens automatically, when user clicks on the view.  
### See also

- [WebView.SetFocus](WebViewSetFocus.md)

### Release notes

- **Version 13.5**
    - Added [Preview.SetFocus](https://www.mbsplugins.eu/PreviewSetFocus.shtml) function.

### Blog Entries

- [New in MBS FileMaker Plugin 13.5](https://www.mbsplugins.de/archive/2023-11-28/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.5pr4](https://www.mbsplugins.de/archive/2023-10-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 14th October 2023 , last changed 14th October 2023

  
[Preview.SetAutostarts](PreviewSetAutostarts.md) - [Preview.SetFrameWithControl](PreviewSetFrameWithControl.md)

[HTML Version](PreviewSetFocus.shtml)