PageControl Colosr Demo

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

 

Search

Search WWW

Search DelphiForFun.org

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.

Contact

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

Search DelphiForFun.org 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  http://cc.embarcadero.com/Author/31580.  (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 

Suggestions for Further Explorations

  ???

 

Original:  June 28, 2011, 2011

Modified:  June 01, 2016

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