Download and install reference: http://www.cnblogs.com/dragon/archive/2005/03/24/124771.html
Test: drag the label and double-click to close the label.
'Close the button to trigger private sub tabcontroller_closepressed (byval sender as system. object, byval e as system. eventargs) handles tabcontroller. closepressed msgbox ("closepressed --" & tabcontroller. selectedtab. name. tostring) end sub 'tab drag and drop dim tabdragging as Boolean private sub tabcontroller_mouseleave (byval sender as object, byval e as system. eventargs) handles tabcontroller. mouseleave if tabdragging = true then 'debug. print ("Stop drag") tabdragging = false me. cursor = cursors. default end if end sub private sub tabcontroller_mousemove (byval sender as object, byval e as system. windows. forms. mouseeventargs) handles tabcontroller. mousemove if E. button = windows. forms. mousebuttons. left then'debug. print ("dragging") tabdragging = true me. cursor = cursors. sizewe elseif E. button = windows. forms. mousebuttons. none then if tabdragging = true then 'debug. print ("Stop drag") tabdragging = false me. cursor = cursors. default end if end sub private sub tabcontroller_mouseup (byval sender as object, byval e as system. windows. forms. mouseeventargs) handles tabcontroller. mouseup if E. button = windows. forms. mousebuttons. left then if tabdragging = true then dim sourcetab as crownwood. magic. controls. tabpage = tabcontroller. selectedtab dim targettab as crownwood. magic. controls. tabpage = tabcontroller. tabpagefrompoint (E. location) dim targetindex as integer =-1 for I = 0 to tabcontroller. tabpages. count-1 If tabcontroller. tabpages (I) is targettab then targetindex = I end if next if sourcetab isnot targettab and targetindex>-1 then tabcontroller. tabpages. remove (sourcetab) tabcontroller. tabpages. insert (targetindex, sourcetab) tabcontroller. selectedtab = sourcetab end if elseif E. button = windows. forms. mousebuttons. middle then if tabdragging = false then 'tabs. action. closeactivetab () end if end sub 'double-click the tag to trigger public sub tabcontroller_doubleclicktab (byval sender as crownwood. magic. controls. tabcontrol, byval page as crownwood. magic. controls. tabpage) handles tabcontroller. doubleclicktab msgbox ("doubleclicktab --" & page. name. tostring) end sub