In a WINDOWS XP system, can change the color pagecontrol label with the following code, the code is as follows:
procedure TfrmPMCDCD. PageControl2DrawTab (Control: TCustomTabControl;,
TabIndex: Integer; Const the Rect: TRect; Active: Boolean);
Var
C: TCanvas;
R: TRect;
MCaption: string;
The mPtr: integer;
MPos: integer;
The begin
R:=the Rect;
C:=PageControl2. Canvas;
If the Active then
The begin
R.T op:=R.T op + 2;
R.L eft:=R.L eft + 2;
R.R d.light:=R.R d.light - 2;
R. b ottom:=r. b ottom - 2;
C.F ont. Color:=clCaptionText;
C.F ont. Style:=C.F ont. Style + [fsBold];
Mount rush. Color:=clActiveCaption;
End
The else
The begin
C.F ont. Color:=clInActiveCaptionText;
C.F ont. Style:=C.F ont. Style - [fsBold];
Mount rush. Color:=clInActiveCaption;
end;
FillRect (c. andle, R, mount rush. The Handle).
If the not Active then
R.T op:=R.T op + 2;
MPos:=TabIndex;
The mPtr:=0;
While (mPtr & lt;=TabIndex) and (mPos & lt; PageControl2. PageCount) do
The begin
If not PageControl2. Pages [mPtr] TabVisible then
Inc (mPos);
Inc (mPtr);
end;
MCaption:=PageControl2. Pages [mPos]. Caption;
C.F illRect (the Rect);
C.T extOut (the Rect. Left + 6, the Rect. Top + 2, mCaption);
end;
But can not be changed in WINDOWS 7, do not know is there a problem, see below,
CodePudding user response:
Renderings are as follows:
Thank you all!
CodePudding user response:
Very strange problemCodePudding user response:
This phenomenon existsCodePudding user response:
I also met the same problem, the top oneCodePudding user response:
Test environment: Windows 2008 R2 + Delphi 20101, by default:

2, modify the PageControl OwenDraw attribute to True, the effect is as follows:

CodePudding user response:
Upstairs, would you please put the font turn redCodePudding user response:

Is this effect???
That is to change "C.F ont. Color:=clCaptionText;" , to "C.F ont. Color:=clRed;"
CodePudding user response:
That is to change "C.F ont. Color:=clCaptionText;" , to "C.F ont. Color:=clRed;"CodePudding user response:
Ha ha, with a third party, don't take this functionalityCodePudding user response:
Still use AlphaControls beautifies the skin, your interface really uglyhttp://download.csdn.net/detail/wozengcong/6595205