Home > Back-end >  Delphi title transparent groupbox control problem
Delphi title transparent groupbox control problem

Time:10-13

How can his title transparent,,,, I already gave transparent GROUPbox

CodePudding user response:

Online, such as the answer,,, a great god come quickly

CodePudding user response:

What is a transparent? Is what groupbox can see below him,,

CodePudding user response:

You are not online??

CodePudding user response:

Yes, I can already and underside of GrOUPBOX background,,,, but there is a white behind his CAPTION text,,, look at feel sick

CodePudding user response:

How do you achieve transparent?

CodePudding user response:

GroupBox1. Brush. Style:=bsClear;
GWL_EXSTYLE SetWindowLong (GroupBox1. Handle, GetWindowLong (GroupBox1. Handle, GWL_EXSTYLE) or WS_EX_TRANSPARENT);

CodePudding user response:

Interface
USES Windows, Messages, Controls, Classes, StdCtrls, ExtCtrls;
Type
TTransGroupBox=class (TGroupBox)
Private
Protected
Procedure WMEraseBkGnd (Var MSG: TWMEraseBkGnd); The message WM_ERASEBKGND;
Public
Procedure CreateParams (Var params: TCreateParams); Override.
Published
end;
TTransRadioGroup=class (TRadioGroup)
Private
Protected
Procedure WMEraseBkGnd (Var MSG: TWMEraseBkGnd); The message WM_ERASEBKGND;
Public
Procedure CreateParams (Var params: TCreateParams); Override.
Published
end;
Procedure Register;
Implementation
{TTransGroupbox}
Procedure TTransGroupbox. CreateParams (Var Params: TCreateParams);
The begin
Inherited CreateParams (params);
Params. ExStyle:=Params. ExStyle or WS_EX_TRANSPARENT;
end;
Procedure TTransGroupbox. WMEraseBkGnd (Var MSG: TWMEraseBkGnd);
The begin
SetBkMode (Msg) DC, Windows. TRANSPARENT);
Msg. Result:=1;
end;
{TTransRadioGroup}
Procedure TTransRadioGroup. CreateParams (Var Params: TCreateParams);
The begin
Inherited CreateParams (params);

CodePudding user response:

Params. ExStyle:=Params. ExStyle or WS_EX_TRANSPARENT;
end;
Procedure TTransRadioGroup. WMEraseBkGnd (Var MSG: TWMEraseBkGnd);
The begin
SetBkMode (Msg) DC, Windows. TRANSPARENT);
Msg. Result:=1;
end;
Procedure Register;
The begin
RegisterComponents (' Transparent - the VCL, [TTransGroupBox TTransRadioGroup]);
end;

CodePudding user response:

Thank you very much,,,,

CodePudding user response:

?? I didn't in CSDN, on October 6, when sent this code?

CodePudding user response:

Delphi xe4 default is transparent
  • Related