Discussion of article "DoEasy. Controls (Part 19): Scrolling tabs in TabControl, WinForms object events"

 

New article DoEasy. Controls (Part 19): Scrolling tabs in TabControl, WinForms object events has been published:

In this article, I will create the functionality for scrolling tab headers in TabControl using scrolling buttons. The functionality is meant to place tab headers into a single line from either side of the control.

Compile the EA and launch it on the chart:


As we can see, everything works as intended.

There are two shortcomings though: if you hover over the tab header area that is hidden, the header reacts by changing color, as if it were visible in this area. This is the reason why the active area of the control does not change its size when the visible area is resized. To fix this, I will need to calculate and resize the active area in accordance with the visible one.

The second shortcoming is that if you move the selected header outside the container and move the panel, then two pixels of the hidden header will be displayed. This has to do with sizing the tab for the scope calculation, as the selected header increases in size on each side by two pixels. To fix this, I need to find a way to get the size of the adjacent header inside the tab header object, according to which the size of the visibility area is calculated.

Author: Artyom Trishkin