Home > Back-end >  WINDOWS 7 cannot change Delphi pagecontrol label color
WINDOWS 7 cannot change Delphi pagecontrol label color

Time:10-07

Everybody is good:
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:
, how to modify the program, can make the software in WINDOWS 7 can also display PageControl tags and color,

Thank you all!

CodePudding user response:

Very strange problem

CodePudding user response:

This phenomenon exists

CodePudding user response:

I also met the same problem, the top one

CodePudding user response:

Test environment: Windows 2008 R2 + Delphi 2010
1, 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 red

CodePudding 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 functionality

CodePudding user response:

Still use AlphaControls beautifies the skin, your interface really ugly
http://download.csdn.net/detail/wozengcong/6595205
  • Related