procedure TForm1.MakeTransparent;
var
AControl: TControl;
A, Margin, X, Y, CtlX, CtlY: Integer;
begin
with Panel1 do begin
Margin := (Width - ClientWidth) div 2;
FullRgn := CreateRectRgn(0, 0, Width, Height);
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
for A := 0 to ControlCount - 1 do
begin
AControl := Controls[A];
if (AControl is TWinControl) or (AControl is TGraphicControl) then with AControl do
begin
if Visible then
begin
CtlX := X + Left;
CtlY := Y + Top;
CtlRgn := CreateRectRgn(CtlX, CtlY, CtlX + Width, CtlY + Height);
CombineRgn(FullRgn, FullRgn, CtlRgn, RGN_OR);
end;
end;
end;
SetWindowRgn(Handle, FullRgn, True);
end;
end;
Robi z panela to samo co z forma.
PS bardzo trudno sie domyslec, poza tym nie mozesz po prsotu nie stawiac panela?
No to jak zrobić przezroczystość panelu lub ucinanie takiego regionu panelu co spowoduje,że będzie prześwitywał w tych miejscach gdzie nie ma żadnego komponentu.
OK zwracam honory, precyzyjnie zadane pytanie ;)