PageControl Colosr Demo

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]




Search WWW


As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.


Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. 


We receive a few cents from each purchase.  Thanks


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Mensa Daily Puzzlers

For over 15 years Mensa Page-A-Day calendars have provided several puzzles a year for my programming pleasure.  Coding "solvers" is most fun, but many programs also allow user solving, convenient for "fill in the blanks" type.  Below are Amazon  links to the two most recent years.

Mensa 365 Puzzlers  Calendar 2017

Mensa 365 Puzzlers Calendar 2018

(Hint: If you can wait, current year calendars are usually on sale in January.)


Feedback:  Send an e-mail with your comments about this program (or anything else).

Search only




Problem Description

 Here's a  program that demonstrates how to use apply colors to tab sheets (TTabsheet) in a page control (TPageControl) and how to add custom visual effects to the tabs of the tab sheets, 

Background & Techniques

For a long time I have been mildly dissatisfied with the lack of default highlighting of the currently selected tab in a page control.   Just never dissatisfied enough to do anything about it.  When I decided to do something using the OnDrawTab event exit of a TPageControl, it didn't seem to work.  Further research uncovered a bug in Delphi 7 (or earlier) versions caused the event exit to be ignored for 64-bit versions of Windows.   During my searches, I also ran across fairly straightforward enhancement by Peter Below which adds a Color property to TTabControls enabling a background color to be defined for each page. 

Peter Below has been contributing to Delphi and Turbo Pascal groups for  as long as I can recall and has me as a fan. When I was learning Pascal and Delphi, his postings in the newsgroups were always those I studied first.   He is now a member of Embarcadero's TeamB. and his postings are available at  (Several are are collections of "snippets" from past years,  which must number in the thousands.)  He's among the best of the good guys in our Delphi fraternity.     

So anyway, here is a little demo program that illustrates both features; coloring tab sheets and customizing tab drawing.  The VCLFixes unit which corrects the Delphi 7 bug is also included.  Oh, and a little DrawSmiley  procedure used to highlight the tab of the active tab sheet "just for fun" .      

Running/Exploring the Program 

bulletDownload executable
bullet Download source

Suggestions for Further Explorations



Original:  June 28, 2011, 2011

Modified:  May 15, 2018

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright 2000-2018, Gary Darby    All rights reserved.