I have several tabpages on a single tab control and I was wondering if anyone out there knows how I can program a way to drag tabpages off the tab control and into their own "form"....pulling the tabcontrol apart?
I'm using vb.net and did find many ways to move the order of tabpages on the tabcontrol but non om how to actually detach the tabpage and place \ drag it elsewhere on the screen?
Assuming WinForms, essentially you have to create a new Form and a new TabControl to house the TabPage you plan on moving.
In its simplest form:
Here I'd like to submit my personal improvement based on LarsTech's code. This version allows the tab to go back to its original parent when the form closes and requires the user to drag the tab away by a defined offset of pixel before the drag event is triggered.
UPDATE: As pointed out in the comments, when the child form is closed, the TabPage is put back in the original TabControl but not in the previous order.
To avoid this behaviour we can assign a priority to the TabPages using the Tag property.
Let's assume we have three TabPages in our TabControl in the order: "Tab C", "Tab A", Tab B". Now we have to set TabA.Tag = 2, TabB.Tag = 3, TabC.Tag = 1.
Then change f.FormClosing code into this:
Source: http://www.vbforums.com/showthread.php?766367-Tabpage-Add-or-insert-tabpage-with-order-determined&s=1b895ca4d79ab29e7c00c4b07a4ce142&p=4692139&viewfull=1#post4692139