From RiskWiki
Jump to: navigation, search

BPCPageControl - Modified MS Windows page/tab control to support customised colouring of tabs and borders

Language: Delphi 7 - 2007

The standard MS Page/Tab controller does not allow non OS controlled tab and border colouring. This colouring defaults to grey or theme controlled settings. This version does uses the page colours to paint the control tabs and borders. Otherwise it looks and behaves exactly like the standard MS Tab/Page Control.

uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, CommCtrl, ComCtrls;


  TBPCPageControl = class(TPageControl)
    FThickFrame: Boolean;
    FBPCFrame : Boolean;
    FFontInactive : TColor;
    procedure SetThickFrame(const Value: Boolean);
    procedure SetBPCFrame(const Value: Boolean);
    procedure WndProc(var Msg: TMessage); override;
    procedure CreateParams(var Params: TCreateParams); override;
    procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
    procedure Change; override;
    constructor Create(AOwner: TComponent); override;
    procedure CustomDrawPageControl;
    property FontInactive: TColor read FFontInactive write FFontInactive default clGray;
    property ThickFrame: Boolean read FThickFrame write SetThickFrame default true;
    property BPCFrame: Boolean read FBPCFrame write SetBPCFrame default True;
//    property BPCTabStyle: Boolean read FBPCFrame write SetBPCFrame default False;