Forum > Packages and Libraries
TATTabs - center tab caption
(1/1)
tudi_x:
hi All,
please advise if it is possible to center the tab caption through a method/property.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.FormShow(Sender: TObject);begin _T := TATTabs.Create(Panel1); _T.Parent := Panel1; _T.Align := alTop; _T.AddTab(-1, 'xxxxxxxxxxxxx'); _T.AddTab(-1, 'yyy yyyyyyyy', nil, False); _T.ColorBg := clWhite; _T.OptShowPlusTab := False; _T.OptShowXButtons := atbxShowNone; _T.OptArrowSize := 0; _T.OptSpaceBetweenTabs := 0; _T.OptColoredBandSize := 0; _T.ColorTabActive := clWhite; _T.ColorTabPassive := clWhite; _T.ColorTabOver := clWhite; _E := TEdit.Create(Panel1); _E.Parent := Panel1; _E.BorderStyle:= bsNone; _E.Align := alClient;end;
thank you Lazarus 1.8
taazz:
--- Quote from: tudi_x on December 07, 2017, 04:11:47 pm ---hi All,
please advise if it is possible to center the tab caption through a method/property.
--- End quote ---
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var vtabData:TATTabData;begin vTabData := _T.GetTabData(0);//FirstTab. vTabData.TabCaption := 'My Caption';end; ATTab is a 3rd party control.
PS
oops, center, not change lost me eyes as it seems. sorry. But the version I have is a bit old and it only has autosized tabs so can't help at the moment.
tudi_x:
thank you
i was also adding captions on lines 7,8.
i added the caption as per your example and the caption is not centered to the tab - i do not see any method on top of caption to center.
should i use the padding?
please advise
saw your update only after i posted.
AlexTP:
property OptCaptionAlignment: TAlignment
does centering.
Navigation
[0] Message Index