08-01-2011، 07:32 PM
از این تابع برای شفاف کردن فرم برنامه خود استفاده نمایید
کد:
procedure TForm1.Button1Click(Sender: TObject);
var
frmRegion, tempRegion: HRGN;
i: Integer;
Arect: TRect;
begin
frmRegion := 0;
for I:= 0 to ControlCount - 1 do begin
aRect := Controls[i].BoundsRect;
OffsetRect( aRect, clientorigin.x - left, clientorigin.y - top );
tempRegion := CreateRectRgnIndirect( aRect );
if frmRegion = 0 then
frmRegion := tempRegion
else begin
CombineRgn( frmRegion, frmRegion, tempRegion, RGN_OR );
DeleteObject( tempRegion );
end;
end;
tempregion :=
CreateRectRgn( 0, 0, Width,
GetSystemMetrics( SM_CYCAPTION )+
GetSystemMetrics( SM_CYSIZEFRAME )+
GetSystemMetrics( SM_CYMENU ) * Ord(Menu <> Nil));
CombineRgn( frmRegion, frmRegion, tempRegion, RGN_OR );
DeleteObject( tempRegion );
SetWindowRgn( handle, frmRegion, true );
end
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg