Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TTabSheet

Posted on 2000-04-10
1
Medium Priority
?
256 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
[X]
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
1 Comment
 
LVL 10

Accepted Solution

by:
Lischke earned 200 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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

618 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