Articles in this section
Category / Section

How to activate the TabPageAdv when holding the mouse over the tab during dragging of TreeNodeAdv across different TabPages in WinForms TabControlAdv?

1 min read

Activate the tab page when holding mouse over the tab while dragging

A TabPageAdv can be activated when holding the mouse over the tab during dragging of TreeNodeAdv using TabControlAdv''s DragOver event.

C#

private void tabControlAdv1_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
{
   int tabIndexHit = this.tabControlAdv1.HitTestTabs(this.tabControlAdv1.PointToClient(new Point(e.X, e.Y)));
   if(tabIndexHit >= 0)
   {
      this.tabControlAdv1.SelectedIndex = tabIndexHit;
   }
   this.tabControlAdv1.ActiveTabColor = Color.LightPink;
}

VB

Private Sub tabControlAdv1_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles tabControlAdv1.DragOver
   Dim tabIndexHit As Integer = Me.tabControlAdv1.HitTestTabs(Me.tabControlAdv1.PointToClient(New Point(e.X, e.Y)))
   If tabIndexHit >= 0 Then
      Me.tabControlAdv1.SelectedIndex = tabIndexHit
   End If
   Me.tabControlAdv1.ActiveTabColor = Color.LightPink
End Sub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied