Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

TTabSheet

Posted on 2000-04-10
1
251 Views
Last Modified: 2010-04-16
How do you change the colour of the canvas of the 'tab' for each tabsheet in a pagecontrol. Here I am referring to the little rectangle which by default contains the text 'TabSheet1'. I am developing in DELPHI 5. NB!!!!
0
Comment
Question by:Diono
1 Comment
 
LVL 10

Accepted Solution

by:
Lischke earned 50 total points
ID: 2715294
Hi Dione,

what you must do is to set the OwnerDraw property of TPageControl to True and assign an OnDrawTab event with something like the following code:

procedure TMainForm.PageControl1DrawTab(Control: TCustomTabControl;
  TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin
  with Control do
  begin
    Canvas.Brush.Color := clRed;
    Canvas.FillRect(Rect);
  end;
end;

Ciao, Mike

PS: There's a special Delphi area here at E-E where question like this will be answered within an hour.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question