SftTabs/NET detects when the user starts dragging a tab. The SftTabs.DragStyle property controls whether the control generates the DragDetected event. Drag & drop is never automatic and must be initiated by the application, usually in the DragDetected event using the Control.DoDragDrop method.
The DragDetected event describes the tab being dragged (TabDragDetectedEventArgs.Tab). An application that starts its own drag & drop operation in this event sets TabDragDetectedEventArgs.Handled to True, which ends the control's own tab reordering (see Tab Reordering).
C#
private void sftTabs1_DragDetected(object sender, TabDragDetectedEventArgs e) { e.Handled = true; sftTabs1.DoDragDrop(e.Tab.Text, DragDropEffects.Copy); }
VB
Private Sub SftTabs1_DragDetected(sender As Object, e As TabDragDetectedEventArgs) Handles SftTabs1.DragDetected e.Handled = True SftTabs1.DoDragDrop(e.Tab.Text, DragDropEffects.Copy) End Sub
As a drop target, a SftTabs/NET control supports drag & drop as offered by all controls, using the AllowDrop property and the DragEnter, DragOver and DragDrop events. While handling these events, the SftTabs.TabFromPoint and SftTabs.HitTest methods return the tab at the mouse location (see Hit Testing).
See Also Tab Control Components