---
id: "T:cAlgo.API.DropZone"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# DropZone (class)

Represents the DropZone control that can be used as a file(s) input.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

## Definition

```csharp
public class DropZone : ControlBase
```

Available since cAlgo.API 5.1.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    protected override void OnStart()
    {
        var dropZone = new DropZone
        {
            Child = new TextBlock
            {
                Text = "Drop / Select Files and Directories",
                BackgroundColor = Color.Blue,
                Height = 200,
                Width = 350,
            },
            IsDirectoryDropAllowed = true,
            // Only these extensions will be accepted
            FilterExtensions = new[] { "txt", "algo", "cs" },
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
        };

        dropZone.Dropped += args =>
        {
            // Here you can access the dropped files and directories, open, read, etc...
            foreach (var path in args.FilePaths)
            {
                Print($"File or directory '{path}' dropped");
            }
        };

        Chart.AddControl(dropZone);
    }
}
```

Python:

```python
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        dropZone = DropZone()

        dropZoneChild = TextBlock()
        dropZoneChild.Text = "Drop / Select Files and Directories"
        dropZoneChild.BackgroundColor = Color.Blue
        dropZoneChild.Height = 200
        dropZoneChild.Width = 350

        dropZone.Child = dropZoneChild
        dropZone.IsDirectoryDropAllowed = True
        # Only these extensions will be accepted
        dropZone.FilterExtensions = ["txt", "algo", "cs"]
        dropZone.HorizontalAlignment = HorizontalAlignment.Center
        dropZone.VerticalAlignment = VerticalAlignment.Center

        dropZone.Dropped += self.on_dropped

        api.Chart.AddControl(dropZone)

    def on_dropped(self, args):
        # Here you can access the dropped files and directories, open, read, etc...
        for path in args.FilePaths:
            api.Print(f"File or directory '{path}' dropped")
```

config.json:

```json
{
  "AccessRights": "None"
}
```

## Constructors

- `public DropZone()` — Initializes a new instance of the DropZone class. [details](https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/Constructor/index.md)

## Properties

- `public ControlBase Child {get; set;}` — Gets or sets the drop zone child object. [details](https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/Child/index.md)
- `public string[] FilterExtensions {get; set;}` — Gets or sets the file extensions filter. [details](https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/FilterExtensions/index.md)
- `public bool IsDirectoryDropAllowed {get; set;}` — Gets or sets whether user can drop directories or not. [details](https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/IsDirectoryDropAllowed/index.md)

## Events

- `public event Action<DroppedEventArgs> Dropped;` — Occurs when files are dropped. [details](https://help.ctrader.com/ctrader-algo/references/Controls/DropZone/Dropped/index.md)

## Inherited members

- `public void ResetProperty(ControlProperty property)` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/ResetProperty/index.md)
- `public Guid UniqueId {get;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/UniqueId/index.md)
- `public Style Style {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Style/index.md)
- `public double Left {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Left/index.md)
- `public double Top {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Top/index.md)
- `public double Right {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Right/index.md)
- `public double Bottom {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Bottom/index.md)
- `public double Width {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Width/index.md)
- `public double Height {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Height/index.md)
- `public double MinWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinWidth/index.md)
- `public double MinHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MinHeight/index.md)
- `public double MaxWidth {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxWidth/index.md)
- `public double MaxHeight {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/MaxHeight/index.md)
- `public bool IsEnabled {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsEnabled/index.md)
- `public bool IsVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsVisible/index.md)
- `public double Opacity {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Opacity/index.md)
- `public Thickness Margin {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Margin/index.md)
- `public VerticalAlignment VerticalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/VerticalAlignment/index.md)
- `public HorizontalAlignment HorizontalAlignment {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/HorizontalAlignment/index.md)
- `public Dock Dock {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/Dock/index.md)
- `public bool IsHitTestVisible {get; set;}` (from ControlBase) [details](https://help.ctrader.com/ctrader-algo/references/Controls/ControlBase/IsHitTestVisible/index.md)

