AdvOfficePage Caption inclomplete drawing

Hi,

I build some new Tabs dynamically and advice captions like this

Grant
Davidson Spilko
Kjellker

Unfortunately the caption looks terrible.

with Form1.pcPlayers do
begin
myNewPage := TAdvOfficePage.Create(self);
myNewPage.ShowClose := True;
if Form1.chkUseLBreakAtNames.Checked then
TabSettings.Height := 90
else
TabSettings.Height := 26;
AddAdvPage(myNewPage);
myNewPage.ShowClose := true;
Form1.pcPlayers.ActivePageIndex := myNewPage.PageIndex;
end;

mySBox := TScrollBox.Create(self);
mySBox.Parent := myNewPage;
mySBox.Align := alClient;
mySBox.Name := 'PFlight_' + InttoStr(myNewPage.PageIndex) + '_' + IntToStr(iFlight);

// Passende Spielerinnen suchen:
for i := Low(EventExternal.Players) to High(EventExternal.Players) do
begin
if EventExternal.Players[i].Rounds[r].FlightNo = iFlight then
begin
DataPanel := TDataPanelSmall.Create(mySBox);
DataPanel.Name := mySBox.Name + '_' + EventExternal.Players[i].ID;
DataPanel.Parent := mySBox;
DataPanel.Visible := true;
DataPanel.cmbRound.Text := Form1.cmbRound.Text;
DataPanel.InitializeGrid(EventExternal.Players[i].ID);
SelectedDataPanelName := DataPanel.Name;
if Form1.chkUseSNamesInTabs.Checked then
begin
if Form1.chkUseLBreakAtNames.Checked then
begin
if TabString <> '' then
TabString := TabString + sLineBreak + LeftStr(EventExternal.Players[i].Lastname,15)
else
TabString := TabString + LeftStr(EventExternal.Players[i].Lastname,15)
end
else
begin
if TabString <> '' then
TabString := TabString + ' - ' + LeftStr(EventExternal.Players[i].Lastname,8)
else
TabString := LeftStr(EventExternal.Players[i].Lastname,8);
end;
end
else
TabString := 'Flight ' + IntToStr(iFlight);
end;
end;

Caption

Any Idea how to deal with this?

Thanks Thomas

I understand you want a multiline tab caption but on your screenshot I see a multiline tab caption. So, I'm not sure what you would want different from this?

Hi Bruno,

thanks for your answer.

Creating dynamically an multiline tab caption is fine, but the text is visually INCOMPLETE.

This is, what i´ve added to the Caption:
Grant
Davidson Spilko
Kjellker

And this is, what we see. So the 3rd name/line is always cutted
Caption

I tried to change the height of the tab, but it seems there are some hidden objects, which hide partly the caption?

Please set TabSettings.WordWrap = true

Good morning Bruno,

Thankyou very much! That helped a lot.

Cheers Thomas