Recent

Author Topic: TabControl "Style"  (Read 1672 times)

Porbitz

  • New Member
  • *
  • Posts: 14
TabControl "Style"
« on: October 16, 2018, 02:09:09 pm »
Hi All,

I have Lazarus 1.8.4 and I'm using a TTabControl component, from the ComCtrls unit. I've set its Style property to tsFlatButtons, but both on design-time and runtime the control keeps showing the "default" tabs (see attachments, btw, the font in runtime is okay, I've configured it). Do I need to do something else to see the buttons instead of the tabs? Is this property not implemented or does it have a bug? I've googled this issue and searched on this forum; alas I've found nothing about it.

Thanks!!

ASerge

  • Hero Member
  • *****
  • Posts: 2212
Re: TabControl "Style"
« Reply #1 on: October 16, 2018, 07:57:04 pm »
Is this property not implemented or does it have a bug?
I think this property is not implemented.
By source:
TCustomTabControl.SetStyle equals FStyle := NewValue and nothing more.
TTabControl.SetStyle overrided and do mistakes:
Code: Pascal  [Select][+][-]
  1.   inherited SetStyle(AValue);
  2.   if FStyle=AValue then exit;
  3.   FStyle:=AValue;
  4.   TTabControlNoteBookStrings(FTabs).Style := AValue;
By inherited behavior, the condition in line 2 is always true (always exit).
Even we remove the call to the inherited method, still TTabControlNoteBookStrings.SetStyle calls TTabControlNoteBookStrings.NoteBook.SetStyle. NoteBook is a descendant of TPageControl, which calls TCustomTabControl.SetStyle i.e. again nothing useful.

 

TinyPortal © 2005-2018