I have a PageControl with the TabPosition set to "tpLeft". You notice when you set that property the caption of the tabs becomes Vertical too, I but i want these captions to appear in a normal horizontal way, tried changing the TabHeight, but it only got wider and the test still appears Vertical.
How can i fix that.
Using DELPHI XE5
update: This code works(Thank to 'Ken White'):
procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
var
I: Integer;
PageControl: TPageControl;
TextFormat: TTextFormat;
Text: string;
TextRect: TRect;
begin
PageControl := Control as TPageControl;
Text := PageControl.Pages[TabIndex].Caption;
for I := Length(Text) - 1 downto 1 do
begin
Text := Copy(Text, 1, I) + Copy(Text, I+1, MaxInt);
end;
TextRect := Rect;
TextRect.Left := TextRect.Left + 5;
TextRect.Top := TextRect.Top + 3;
TextFormat := [tfCenter];
PageControl.Canvas.TextRect(
TextRect,
Text,
TextFormat
);
end;
but is this the "right way" to do it, are there any other better methods?