Drag and drop tabs in Windows Forms Tabbed Form (SfTabbedForm)
3 Sep 2020 / 2 minutes to read
Tabbed Form allows move the tabs from one position to another position by dragging the corresponding tab. This can be done by setting the TabbedFormControl.AllowDraggingTabs property to true
.
tabbedFormControl.AllowDraggingTabs = true;
tabbedFormControl.AllowDraggingTabs = True
Cancel tab dragging
Dragging a particular tab in TabbedForm
can be canceled by handling the TabDragging event by setting e.Cancel
to true
when e.Action is TabDraggingAction.DragStarting.
this.TabbedFormControl.TabDragging += OnTabDragging;
private void OnTabDragging(object sender, TabDraggingEventArgs e)
{
if (e.From == 1 && e.Action == TabDraggingAction.DragStarting)
e.Cancel = true;
}
AddHandler TabbedFormControl.TabDragging, AddressOf OnTabDragging
Private Sub OnTabDragging(ByVal sender As Object, ByVal e As TabDraggingEventArgs)
If e.From = 1 AndAlso e.Action = TabDraggingAction.DragStarting Then
e.Cancel = True
End If
End Sub
Cancel tab reordering
Re-ordering a tab to a particular position can be canceled by handling TabDragging event by setting e.Cancel
to true
when e.Action is TabDraggingAction.DragDropping.
this.TabbedFormControl.TabDragging += OnTabDragging;
private void OnTabDragging(object sender, TabDraggingEventArgs e)
{
if (e.To == 1 && e.Action == TabDraggingAction.DragDropping)
e.Cancel = true;
}
AddHandler TabbedFormControl.TabDragging, AddressOf OnTabDragging
Private Sub OnTabDragging(ByVal sender As Object, ByVal e As TabDraggingEventArgs)
If e.To = 1 AndAlso e.Action = TabDraggingAction.DragDropping Then
e.Cancel = True
End If
End Sub
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page