Version

MdiTabDropAction Enumeration

Enumerations of MdiTab drag drop actions
Syntax
'Declaration
 
Public Enum MdiTabDropAction 
   Inherits System.Enum
public enum MdiTabDropAction : System.Enum 
Members
MemberDescription
ContextMenuA context menu will be displayed to determine the action taken.
NewHorizontalGroupThe tab will be positioned in a new horizontal group
NewVerticalGroupThe tab will be positioned in a new vertical group
NoneNo action is being taken. Occurs when the mouse is released over an invalid location.
TabGroupThe tab is being repositioned in an MdiTabGroup.
Example
The following sample demonstrates how to use the information passed to the TabDragOver event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub ultraTabbedMdiManager1_TabDragOver(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.MdiTabDragOverEventArgs) Handles ultraTabbedMdiManager1.TabDragOver
    ' The 'TabDragOver' event is invoked during a drag operation
    ' as the mouse is repositioned. The 'DropAction' indicates
    ' the action that will be taken if the mouse is released
    ' at this point.
    '

    Select Case e.DropAction
        Case MdiTabDropAction.TabGroup
            ' if the tab came from another tab group
            ' is attempting to drag it over an edit group,
            ' then prevent the drop
            If Not e.TabGroup Is e.Tab.TabGroup AndAlso e.TabGroup.Key = "Edit" Then
                ' The 'AllowDrop' may be set to false to indicate
                ' that the specified point is not a valid drop location.
                e.AllowDrop = False

                ' The 'DragCursor' may be used to show a specific cursor 
                ' for the 'Point' being processed.
                e.DragCursor = Cursors.No
            End If
            Exit Sub
        Case MdiTabDropAction.NewHorizontalGroup
        Case MdiTabDropAction.NewVerticalGroup
            ' the point must be over a splitter bar
            ' or near the edge of the mdi client area
            Exit Sub
        Case MdiTabDropAction.ContextMenu
            ' prevent the display of a context menu if
            ' the mouse is released within the mdi client area
            e.AllowDrop = False
            Exit Sub
    End Select
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void ultraTabbedMdiManager1_TabDragOver(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabDragOverEventArgs e)
{
	// The 'TabDragOver' event is invoked during a drag operation
	// as the mouse is repositioned. The 'DropAction' indicates
	// the action that will be taken if the mouse is released
	// at this point.
	//

	switch(e.DropAction)
	{
		case MdiTabDropAction.TabGroup:
		{
			// if the tab came from another tab group
			// is attempting to drag it over an edit group,
			// then prevent the drop
			if (e.TabGroup != e.Tab.TabGroup && 
				e.TabGroup.Key == "Edit")
			{
				// The 'AllowDrop' may be set to false to indicate
				// that the specified point is not a valid drop location.
				e.AllowDrop = false;

				// The 'DragCursor' may be used to show a specific cursor 
				// for the 'Point' being processed.
				e.DragCursor = Cursors.No;
			}
			break;
		}
		case MdiTabDropAction.NewHorizontalGroup:
		case MdiTabDropAction.NewVerticalGroup:
			// the point must be over a splitter bar
			// or near the edge of the mdi client area
			break;
		case MdiTabDropAction.ContextMenu:
			// prevent the display of a context menu if
			// the mouse is released within the mdi client area
			e.AllowDrop = false;
			break;
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also