[Home] [Puzzles & Projects] [Delphi Techniques] [Math topics] [Library] [Utilities]
|
|
Problem DescriptionHere'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 & TechniquesFor 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
|
[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 2000-2018, Gary Darby All rights reserved. |