# Using Touch Support with Drag and Fill

Learn how to use touch support gestures and the touch menu bar to drag and fill ranges in Spread.NET with our comprehensive tutorial.

## Content

You can use touch support gestures and the touch menu bar or toolbar with drag and fill.
Select a range. Tap the range to display the touch menu bar. Tap the **AutoFill** menu item to display the drag fill handle at the bottom-right edge of the selected range. Press and slide the handle to drag and fill the range. The [AllowDragFill](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.AllowDragFill.html) property must be true to display and use the drag fill handle.
![Custom Drag and Fill](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/customdragfill.png)
![Drag and Fill Operation](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/tsdragfill.png)
The following image shows the Drag Fill Drop Down Context Menu:
![Drag Fill Drop Down Context Menu](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/drag_fill4.png)

## Using Code

This example adds the drag fill icon to the touch menu bar.

1. Set the [AllowDragFill](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.AllowDragFill.html) property to true.
2. Create a new touch strip button and separator in the [TouchStripOpening](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.TouchStripOpening.html) event.
3. Create an image for the new button.
4. Add the new items to the touch strip.
5. Create and use an event to display the auto fill indicator.

```csharp
void autoFill_Click(object sender, EventArgs e)
        {
         FarPoint.Win.Spread.SpreadView activeView = fpSpread1.GetRootWorkbook().GetActiveWorkbook();
            if (activeView != null)
            {
                activeView.ShowAutoFillIndicator();
            }
        }

private void Form1_Load(object sender, EventArgs e)
    {
        fpSpread1.AllowDragFill = true;
    }
        private void fpSpread1_TouchStripOpening(object sender, FarPoint.Win.Spread.TouchStripOpeningEventArgs e)
        {
            e.Cancel = true;
            FarPoint.Win.Spread.CellTouchStrip touchStrip = new FarPoint.Win.Spread.CellTouchStrip(fpSpread1);
            ToolStripSeparator separator = new ToolStripSeparator();
            FarPoint.Win.Spread.TouchStripButton autoFill = new FarPoint.Win.Spread.TouchStripButton("AutoFill", System.Drawing.Image.FromFile("C:\\SpreadWin7\\dragfill.png") );
            autoFill.Click += autoFill_Click;
            touchStrip.Items.AddRange(new ToolStripItem[] { separator, autoFill });
            touchStrip.Show(new Point(e.X - 20, e.Y - 35 - touchStrip.Height));
        }
```

```vbnet
Private Sub autoFill_Click(sender As Object, e As EventArgs)
               Dim activeView As FarPoint.Win.Spread.SpreadView = fpSpread1.GetRootWorkbook().GetActiveWorkbook()
               If activeView IsNot Nothing Then
                              activeView.ShowAutoFillIndicator()
               End If
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
     fpSpread1.AllowDragFill = True
End Sub
Private Sub fpSpread1_TouchStripOpening(sender As Object, e As FarPoint.Win.Spread.TouchStripOpeningEventArgs)
               e.Cancel = True
               Dim touchStrip As New FarPoint.Win.Spread.CellTouchStrip(fpSpread1)
               Dim separator As New ToolStripSeparator()
               Dim autoFill As New FarPoint.Win.Spread.TouchStripButton("AutoFill", System.Drawing.Image.FromFile("C:\SpreadWin7\dragfill.png"))
               AddHandler autoFill.Click, AddressOf autoFill_Click
               touchStrip.Items.AddRange(New ToolStripItem() {separator, autoFill})
               touchStrip.Show(New Point(e.X - 20, e.Y - 35 - touchStrip.Height))
End Sub
```

## See Also

[Using Touch Support with AutoFit](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsautofit)
[Using Touch Support with Cell Notes](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tscellnote)
[Using Touch Support with Charts](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tschart)
[Using Touch Support with Clipboard Operations](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsclipboard)
[Using Touch Support with Drop-Down Elements](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tselements)
[Using Touch Support with Editable Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tseditcells)
[Using Touch Support with InputMan Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsinputman)
[Using Touch Support with Filtering](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsfilter)
[Using Touch Support with Grouping](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsrangegroup/tsgrouping)
[Using Touch Support with Range Grouping](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsrangegroup)
[Using Touch Support when Moving Columns or Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsmove)
[Using Touch Support when Resizing Columns or Rows](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsresize)
[Using Touch Support with Scrolling](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsscroll)
[Using Touch Support with Selections](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsselection)
[Using Touch Support with Shapes](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsshapes)
[Using Touch Support when Sorting](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tssort)
[Using Touch Support with Viewports](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tsviewport)
[Using Touch Support with the Tab Strip](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tstabstrip)
[Using Touch Support with Zooming](/spreadnet/docs/latest/online-win/overview/spwin-devguide/tsmain/tsusing/tszoom)