Search code examples
delphifiremonkeydelphi-xe8

TabControl Navigation Buttons / Determine if Tab is Visible


I am trying to add tabcontrol navigation buttons like Notepad++ has.

I am using Firemonkey in Delphi-XE8.

notepad++

I first must determine if all tabs are visible.

So here is the form:

formwithtabs

And if i resize it the third tab is gone:

formwithouttab

Things i tried that didn't work to check if a tab is visible:

TabItem1.IsVisible

TabControl1.FindVisibleTab(2, TTabControl.TFindKind.Current)

TabControl1.FindVisibleTab(TTabControl.TFindKind.Last)

Or maybe someone knows a better way to implement tabcontrol buttons?


Solution

  • This is NOT good solution, based only on my experience

    1st way set "TTabControl.FullSize" to True, but this will change how your TabControl looks

    enter image description here

    2nd way even worse, because it's "dog-nail" aka "cruke solution"

    if TabControl1.Tabs[2].AbsoluteMatrix.m32 = 65535 then
      begin
        { TAB NOT VISIBLE }
      end
    else
      begin
        { TAB VISIBLE }
      end;