Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caption for TTabControl

I'm looking for a way of implementing a sort of inset caption before a set of tabs, something like this:

enter image description here

The tab set is not supposed to be multi-line, will only be horizontal and laid out at the top. However it should be correctly scrollable when there are too many tabs.

I fear I'm going to be restricted here with regard to using third-party controls, but I could use subclassing on the standard TTabControl to add the necessary changes to the standard looks and behaviour. (I don't need it to be TPageControl, because it's only the specific arrangement of the tabs that I am interested in.)

Maybe there's some way of implementing this with craftily arranged combination of standard controls, which, despite my endevours, has escaped me.

Basically, any ideas or pointers are welcome.

Oh, and additional requirement is, it should blend well with desktop themes.

like image 793
Andriy M Avatar asked Apr 07 '11 12:04

Andriy M


1 Answers

Granted some time has passed, but I recently needed this style and found you can do it with the TMS Software TAdvOfficePager. It has a property FixedTabs, which I set to 1 in this case. It also has an OnChanging event where you can prevent access to a tab, in this case I used AllowChange := (ToPage > 0); Lastly, I set the first tab to disabled.

Then just style the first tab different than the rest and you can have something like this:

enter image description here

like image 65
Tony Avatar answered Sep 21 '22 15:09

Tony