DragDrop.SetFrameWithControl
----------------------------

Repositions drop area to given control.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DragDrop](component_DragDrop.md) | [8.5](newinversion85.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "DragDrop.SetFrameWithControl"; droparea; ControlName { ; DX; DY } ) 

**MBS**( **"DragDrop.SetFrameWithControl";** /\* Repositions drop area to given control. \*/  
**$droparea**; /\* The reference ID for this drop area.e.g. $dropHandle \*/   
**$ControlName**; /\* The name of the control on your FileMaker form.   
e.g. you can place a rectangle there to define the position.e.g. "mymedia" \*/   
**$DX**; /\* Optional; A delta to move drop area more to left or right.e.g. 0 \*/   
**$DY**) /\* Optional; A delta to move drop area more to top or bottom.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| droparea | The reference ID for this drop area. | $dropHandle |  |
| ControlName | The name of the control on your FileMaker form.    e.g. you can place a rectangle there to define the position. | "mymedia" |  |
| DX | A delta to move drop area more to left or right. | 0 | Optional |
| DY | A delta to move drop area more to top or bottom. | 0 | Optional |

### Result

Returns OK or error.

### Description

Repositions drop area to given control.  
If you moved control in layout mode, this can move the drop area back to the new position.  
Also useful to switch between different locations on the layout.  
  
Can be used with OnLayoutSizeChange script trigger to reposition control whenever the window changes size.  
### Examples

Move drop area:

 Set Variable \[ $r ; Value: MBS ( "DragDrop.SetFrameWithControl"; $$dropview ; "drop") \]  
### See also

- [AVPlayer.SetFrameWithControl](AVPlayerSetFrameWithControl.md)
- [DragDrop.CreateWithControl](DragDropCreateWithControl.md)
- [DragDrop.SetFrame](DragDropSetFrame.md)
- [ImageView.SetFrameWithControl](ImageViewSetFrameWithControl.md)
- [MapView.SetFrameWithControl](MapViewSetFrameWithControl.md)
- [Overlay.SetFrameWithControl](OverlaySetFrameWithControl.md)
- [Preview.SetFrameWithControl](PreviewSetFrameWithControl.md)
- [TextView.SetFrameWithControl](TextViewSetFrameWithControl.md)
- [WebView.SetFrameWithControl](WebViewSetFrameWithControl.md)

### Release notes

- **Version 10.3**
    - Rewrote control placement for MacOS and iOS controls for [AVPlayer.SetFrameWithControl](https://www.mbsplugins.eu/AVPlayerSetFrameWithControl.shtml), [DragDrop.SetFrameWithControl](https://www.mbsplugins.eu/DragDropSetFrameWithControl.shtml), [ImageView.SetFrameWithControl](https://www.mbsplugins.eu/ImageViewSetFrameWithControl.shtml), [MapView.SetFrameWithControl](https://www.mbsplugins.eu/MapViewSetFrameWithControl.shtml) [TextView.SetFrameWithControl](https://www.mbsplugins.eu/TextViewSetFrameWithControl.shtml), [WebView.SetFrameWithControl](https://www.mbsplugins.eu/WebViewSetFrameWithControl.shtml).
- **Version 8.5**
    - Added [DragDrop.SetFrameWithControl](http://www.mbsplugins.eu/DragDropSetFrameWithControl.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 10.3pr3](https://www.mbsplugins.de/archive/2020-06-12/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr3](https://www.mbsplugins.de/archive/2018-10-24/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 19th October 2018 , last changed 4th August 2020

  
[DragDrop.SetFrame](DragDropSetFrame.md) - [DragDrop.SetImage](DragDropSetImage.md)

[HTML Version](DragDropSetFrameWithControl.shtml)