Skip to main content
Table of Contents

TTMSFNCToolBar.OnDragGripMoving Event

Fires continuously while the user drags the toolbar by its grip handle.

API unit family: TMSFNCToolBar Declaring type: TTMSFNCToolBar Inherited from: TTMSFNCCustomToolBar

Syntax

FMX.TMSFNCToolBar.hppPascalC++
OnDragGripMoving: TTMSFNCToolBarDragGripMovingEvent;
__property TTMSFNCToolBarDragGripMovingEvent OnDragGripMoving = {read=FOnDragGripMoving, write=FOnDragGripMoving};

Parameters

Name Description
Sender The toolbar being dragged.
DeltaX Horizontal movement in pixels since the last event.
DeltaY Vertical movement in pixels since the last event.

Usage examples

Show a drag grip and track dragging

Enables the drag-grip handle and reports the drag delta as the user moves the toolbar.

Show a drag grip and track draggingPascalC++
procedure TForm1.EnableDragGrip;
begin
  // Draw a drag-grip handle at the toolbar edge and track dragging.
  TMSFNCToolBar1.Appearance.DragGrip := True;
  TMSFNCToolBar1.OnDragGripMoving := ToolBarDragGripMoving;
end;

procedure TForm1.ToolBarDragGripMoving(Sender: TObject; DeltaX, DeltaY: Double);
begin
  // DeltaX/DeltaY report how far the toolbar has moved since the drag started.
  StatusBar1.SimpleText := Format('Moved %.0f, %.0f', [DeltaX, DeltaY]);
end;
void __fastcall TForm1::EnableDragGrip()
{
  // Draw a drag-grip handle at the toolbar edge and track dragging.
  TMSFNCToolBar1->Appearance->DragGrip = true;
  TMSFNCToolBar1->OnDragGripMoving = ToolBarDragGripMoving;
}

void __fastcall TForm1::ToolBarDragGripMoving(TObject *Sender, double DeltaX, double DeltaY)
{
  // DeltaX/DeltaY report how far the toolbar has moved since the drag started.
  StatusLabel->Text = Format("Moved %.0f, %.0f", ARRAYOFCONST(((Extended)DeltaX, (Extended)DeltaY)));
}

Read the related guide