Discussion of article "DoEasy. Controls (Part 18): Functionality for scrolling tabs in TabControl"

 

New article DoEasy. Controls (Part 18): Functionality for scrolling tabs in TabControl has been published:

In this article, I will place header scrolling control buttons in TabControl WinForms object in case the header bar does not fit the size of the control. Besides, I will implement the shift of the header bar when clicking on the cropped tab header.

The panels are created in a loop (for now, there is only one panel), because it turned out that if you create several panels with TabControl controls, these controls do not work correctly. To fix that, I will create the required number of panels.

Let's compile the EA and run it on the chart after setting the required settings:


As we can see, the declared functionality works correctly.

Author: Artyom Trishkin

 
Good afternoon!)

In general useful function, but it looks visually not elegant, how to do otherwise, honestly do not know, but at least in the size with the buttons)

Perhaps it would be more elegant to make a classic scroll bar, but this is an option, and in general it is strange to make so many tabs horizontal, even in terms of management it is kaaaapets as inconvenient, with a large number of tabs is more logical to make the menu on the left and give the opportunity to hide....

p.s. I use the standard library, it works faster and more stable, but not all elements are there, I have to supplement.
 
Daniil Kurmyshev scroll bar, but this is an option, and in general it is strange to make so many tabs horizontal, even in terms of management it is kaaaapetsya how inconvenient, with a large number of tabs is already logical to make the menu on the left and give the opportunity to hide....

Here we are developing an analogue of TabControl control from MS Visual Studio. Naturally, the object has the ability to place tab titles in several rows and on different sides of the container. The scrolling control buttons are made similar to the above-mentioned object. The size - height, of the headers is customisable. Here in the example, the height of the buttons is made bigger on purpose - to see how the trimming is done - the same as in TabControl from MS Visual Studio:

Naturally, the scroll control buttons are a bit different in appearance. But this is fixable - you need to fill them not with a uniform colour, but with a gradient (it is possible here, it's just too early to do design finesse), as well as the size of the arrows will be selected later.

There is no classic scroll bar in this control for tab headers - and it won't be there - that's not why it's here. But those elements that can be placed on tab fields - they will have a standard scroll bar (customisable at will).