Transparent control Groupbox, RadioGroup

xiaoxiao2021-03-06  54

Interface

Uses Windows, Messages, Controls, Classes, Stdctrls, ExtCtrls

type TTransGroupBox = class (TGroupBox) private protected procedure WMEraseBkGnd (Var msg: TWMEraseBkGnd); message WM_ERASEBKGND; public procedure CreateParams (Var params: TCreateParams); override; published end;

TTransRadioGroup = class (TRadioGroup) private protected procedure WMEraseBkGnd (Var msg: TWMEraseBkGnd); message WM_ERASEBKGND; public procedure CreateParams (Var params: TCreateParams); override; published end;

PROCEDURE register;

IMPLEMentation

{TTRANSGROUPBOX} Procedure TTRANSGROUPBOX.CREATEPARAMS (VAR params: TcreateParams); Begin Inherited CreateParams (params); params.exStyle: = params.exstyle or ws_ex_transparent; End;

Procedure TTRANSGROUPBOX.WMERASEBKGND (VAR Msg: TwmeseBkgnd); Begin SetBkmode (msg.dc, windows.transparent); msg.result: = 1; END;

{TTransRadioGroup} procedure TTransRadioGroup.CreateParams (Var Params: TCreateParams); begin inherited CreateParams (params); Params.ExStyle: = Params.ExStyle or WS_EX_TRANSPARENT; end;

Procedure TTRASRADIOGROUP.WMERASEBKGND (VAR Msg: TwmeseBkgnd); Begin setBkmode (msg.dc, windows.transparent); msg.result: = 1;

Procedure Register; Begin RegisterComponents ('Transparent-VCl', [TTRANSGROUPBOX, TTRASRADIOGROUP]); END; // If you are interested in BCB, this also has an implementation http://blog.9cbs.net/cker/archive/2004/06 / 29/24110.aspx

转载请注明原文地址:https://www.9cbs.com/read-118664.html

New Post(0)