Tabcontroller control test

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.