VitNX_DockGroup.OnMouseMove Method

Raises the MouseMove event.
protected override void OnMouseMove( 
MouseEventArgs e 
)
This language is not supported or no code example is available.

Parameters

e
MouseEventArgs

A MouseEventArgs that contains the event data.

protected override void OnMouseMove(MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (_dragTab != null)
     {
         var offsetX = e.Location.X + _tabArea.Offset;
         if (offsetX < _dragTab.ClientRectangle.Left)
         {
             if (_dragTab.DockContent.Order > 0)
             {
                 var otherTabs = _tabs.Values.Where(t => t.DockContent.Order ==
                 _dragTab.DockContent.Order - 1).ToList();
                 if (otherTabs.Count == 0)
                     return;
                 var otherTab = otherTabs.First();
                 if (otherTab == null)
                     return;
                 var oldIndex = _dragTab.DockContent.Order;
                 _dragTab.DockContent.Order = oldIndex - 1;
                 otherTab.DockContent.Order = oldIndex;
                 BuildTabs();
                 EnsureVisible();
                 _tabArea.RebuildMenu();
                 return;
             }
         }
         else if (offsetX > _dragTab.ClientRectangle.Right)
         {
             var maxOrder = _contents.Count;
             if (_dragTab.DockContent.Order < maxOrder)
             {
                 var otherTabs = _tabs.Values.Where(t => t.DockContent.Order ==
                 _dragTab.DockContent.Order + 1).ToList();
                 if (otherTabs.Count == 0)
                     return;
                 var otherTab = otherTabs.First();
                 if (otherTab == null)
                     return;
                 var oldIndex = _dragTab.DockContent.Order;
                 _dragTab.DockContent.Order = oldIndex + 1;
                 otherTab.DockContent.Order = oldIndex;
                 BuildTabs();
                 EnsureVisible();
                 _tabArea.RebuildMenu();
                 return;
             }
         }
         return;
     }
     if (_tabArea.DropdownRectangle.Contains(e.Location))
     {
         _tabArea.DropdownHot = true;
         foreach (var tab in _tabs.Values)
             tab.Hot = false;
         Invalidate();
         return;
     }
     _tabArea.DropdownHot = false;
     foreach (var tab in _tabs.Values)
     {
         var rect = RectangleToTabArea(tab.ClientRectangle);
         var hot = rect.Contains(e.Location);
         if (tab.Hot != hot)
         {
             tab.Hot = hot;
             Invalidate();
         }
         var closeRect = RectangleToTabArea(tab.CloseButtonRectangle);
         var closeHot = closeRect.Contains(e.Location);
         if (tab.CloseButtonHot != closeHot)
         {
             tab.CloseButtonHot = closeHot;
             Invalidate();
         }
     }
 }
					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

.NET Core

Supported in: 5.0+, 6.0+

In this article

Definition