Graphic Delphi

Title: Coloring Tabs in PageControl
Question: I'd like to color tabs of my PageControl on the MainForm. Let's see what we can do.
Answer:
// first of all making onDrawTab event
Procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin
case TabIndex of
0: Control.Canvas.Brush.Color:=clgreen;
1: Control.Canvas.Brush.Color:=clred;
2: Control.Canvas.Brush.Color:=clblue;
3: Control.Canvas.Brush.Color:=clYellow;
4: Control.Canvas.Brush.Color:=clMaroon;
5: Control.Canvas.Brush.Color:=clWhite;
end;
Control.Canvas.TextOut(Rect.left+5,Rect.top+3,PageControl1.Pages[tabindex].Caption);
PageControl1.Pages[TabIndex].Brush.Color:=Control.Canvas.Brush.Color;
end;
// And Then while Form creating pointing
// that we have an our own Draw Method for desired PageControl
procedure TForm1.FormCreate(Sender: TObject);
begin
PageControl1.OwnerDraw:=true;
end;