PageControl本身就可以,将PageControl的OwnerDraw设为true,然后在其OnDrawTab中加入:
procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin
with PageControl1.Canvas do
begin
case TabIndex of
0: Brush.Color := clYellow;
1: Brush.Color := clRed;
end;
FillRect(Rect);
TextOut(Rect.Left + 2, Rect.Top + 2, pagecontrol1.Pages[TabIndex].Caption);
end;
end;
end;