I’m recently tried to make a custom tabcontrol that able to move the tab to left or right…
But there’s a problem, I’m don’t know how to get the tab’s item width… What I get with TabControl1.SelectedTab.Bounds.Width is the tabpage’s width, not tab item’s width…
I need to get tab item’s width to know if the selected tab had to be stay, or move left, or move right, when the mouse is moving and holding…
For an example, if the cursor pressed and holding Tabpage1, and it move to Tabpage2, then the Tabpage1 should be move right…
If I can get the tab item’s width, then I can know the cursor is on which tab by mathematics… Or if can, I want to get the tab that on the cursor directly…
Maybe my question is weird, my code idea is silly, stupid or even crazy until you can’t understand this question… If you have a better code idea, or answer for this question, then please reply…
Use TabControl.GetTabRect() to get the tab rectangle. Pass the index of the tab you are interesting in.