6/3/2023 0 Comments Lazarus groupbox change color![]() ![]() ![]() Use the form's default colour as a background, while the newĬomponents are truly transparent (except for the label of the group You'll see the normal label and group box We've painted a candy stripe background on the form to helpĭemonstrate transparency. Create ( AOwner : TComponent ) begin inherited ControlStyle := ControlStyle - end end. Unit Unit1 interface uses Forms, Classes, Controls, StdCtrls, Messages type // Example of a TWinControl derived control TGroupBo圎x = class ( TGroupBox ) protected procedure CreateParams ( var params : TCreateParams ) override procedure WMEraseBkGnd ( var msg : TWMEraseBkGnd ) message WM_ERASEBKGND end // Example of a TGraphicControl derived control TLabelEx = class ( TLabel ) public constructor Create ( AOwner : TComponent ) override end type TForm1 = class ( TForm ) procedure FormCreate ( Sender : TObject ) procedure swe3 ( Sender : TObject ) private fGB : TGroupBox // standard group box fGBX : TGroupBo圎x // transparent group box fLbl : TLabel // standard label fLblX : TLabelEx // transparent label end var Form1 : TForm1 implementation uses Windows, Graphics constructor TLabelEx.
0 Comments
Leave a Reply. |