Hi,
I've implemented Drag & Drop in Tab control and I want cursor to be changed while dragging Tabs. I got that part too, but with one slight problem - normally you change cursor on GiveFeedback event when you allready started drag drop action. Unfortunally I also set start of drag/drop in Mousedown, so when I click to change Tab page my new dragging cursor also appears for a moment, because left mouse click was done. Is there any way that I could start drag/drop with left mouse after I changed Tab page, and then change cursor ?
My code:
Code:Protected Overrides Sub OnMouseDown(e As MouseEventArgs) MyBase.OnMouseDown(e) 'Current tab is checked in MouseMove, and It's added into Tag If Not Me.Tag Is Nothing Then Dim clickedTab As TabPage = DirectCast(Me.Tag, TabPage) Dim clicked_index As Integer = Me.TabPages.IndexOf(clickedTab) ' start drag n drop Me.DoDragDrop(clickedTab, DragDropEffects.All) End If End Sub Protected Overrides Sub OnGiveFeedback(gfbevent As GiveFeedbackEventArgs) MyBase.OnGiveFeedback(gfbevent) ' Set the custom cursor based upon the effect. gfbevent.UseDefaultCursors = False If ((gfbevent.Effect And DragDropEffects.Move) = DragDropEffects.Move) Then Cursor.Current = Cursors.Hand Else Cursor.Current = Cursors.Default End If End Sub




Reply With Quote
