TAdvPageControl issue

Please look at the attached project:

TAdvPageControl_Test.zip (80.9 KB)

Each TabSheet of the TAdvPageControl has assigned a different ImageIndex property (both at design-time and at run-time), but the TabSheets all display the same icon both at design-time and at run-time:

procedure TForm1.FormCreate(Sender: TObject);
begin
AdvTabSheetOptions.ImageIndex := 0;
AdvTabSheetHome.ImageIndex := 1;
AdvTabSheetWork.ImageIndex := 2;
end;

QUESTION:
Is this a known bug in TAdvPageControl? Is there a property setting or workaround that makes individual tab icons work correctly?

My system:
Delphi 13
Windows 11

We investigated and could see this regression.
We applied a fix and next update will address this.

Thank you very much for your excellent support!

Unfortunately, there is another issue in TAdvPageControl:

The Settings for the Active Page are not applied:

According to the settings shown in the Object Inspector, the Caption text font for the active Page should be BOLD and RED.

Can you please fix this bug too? Thank you!

This feature is available when TabBorder3D = false, otherwise, Windows is responsible for this tab drawing and doesn’t allow font customization.

Thanks for the hint! Indeed, when setting TabBorder3D = False in the Object Inspector, all the other visual properties of TAdvPageControl are suddenly applied:

You would never guess from the name "TabBorder3D" that this property has such a dramatic effect!

Isn’t there a “STYLER” component for TAdvPageControl that summarizes all those visual properties under a user-friendly name?

TabBorder3D is a property that is inherited from the base control standard VCL TPageControl. So, we cannot change its name. This property controls whether the Windows API accepts a custom drawn tab or not.
For a page control that we built from the ground up and thus has no Windows drawing restrictions and for which we do have a styler component, please have a look at TAdvOfficePager:

https://www.tmssoftware.com/site/aop.asp

1 Like

Dear Bruno,

There is another issue in TAdvPageControl:

I have assigned Hints to the tab-sheets. But unfortunately, the Hint is displayed only AFTER having opened a tab inside the tab-container area, but not on still the closed tab (where it would be more useful):

Is there a solution or a workaround for this issue?

I have found a workaround for this:

procedure TForm1.AdvPageControl1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
TabIndex: Integer;
begin
// 1. Find which tab is under the mouse cursor
TabIndex := AdvPageControl1.IndexOfTabAt(X, Y);

if TabIndex >= 0 then
begin
// 2. We are over a tab.
// Check if the hint text is different to avoid flickering.
if AdvPageControl1.Hint <> AdvPageControl1.Pages[TabIndex].Hint then
begin
// Close any currently visible hint so the new one can appear
Application.CancelHint;

  // "Borrow" the hint from the TabSheet and assign it to the PageControl
  AdvPageControl1.Hint := AdvPageControl1.Pages[TabIndex].Hint;
end;

end
else
begin
// 3. We are NOT over a tab header (mouse is in the page body or empty space).
// Clear the hint so we don't show a stale tab hint.
AdvPageControl1.Hint := '';
end;
end;

Thanks for informing about this work-around.
Hint handling is also something originating from the VCL standard base control TPageControl.