unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit2, ExtCtrls, StdCtrls, Grids;
type
TGrundForm3 =
class(TGrundForm2)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
GrundForm3: TGrundForm3;
implementation
{$R *.dfm}
procedure TGrundForm3.FormCreate(Sender: TObject);
// (C) swissdelphicenter bzw. Beitragsschreiber
const
bgcolor = $00FFDDEE;
linecolor = $00554366;
var
img:
array of TImage;
reg: hrgn;
i: Integer;
begin
inherited;
for i := 0
to ComponentCount - 1
do
begin
if Components[i].ClassName = '
TPanel'
then
begin
setlength(img, Length(img) + 1);
img[i] := TImage.Create(Self);
img[i].Width := (Components[i]
as TPanel).Width;
img[i].Height := (Components[i]
as TPanel).Height;
img[i].Parent := (Components[i]
as TPanel);
img[i].Canvas.Brush.Color := clSkyBlue;
// Änderung !!
img[i].Canvas.pen.Color := bgcolor;
img[i].Canvas.Rectangle(0,0,img[i].Width, img[i].Height);
img[i].Canvas.pen.Color := linecolor;
img[i].Canvas.RoundRect(0,0,img[i].Width - 1,img[i].Height - 1,20,20);
reg := CreateRoundRectRgn(0,0,(Components[i]
as TPanel).Width,
(Components[i]
as TPanel).Height, 20,20);
setwindowrgn((Components[i]
as TPanel).Handle, reg, True);
deleteobject(reg);
end;
end;
end;
procedure TGrundForm3.Button1Click(Sender: TObject);
begin
inherited;
showmessage ('
blubb');
end;
end.