السلام عليكم
او
دالة بسيطة لتغير شكله الى دئرة و مقروطة
او
دالة بسيطة لتغير شكله الى دئرة و مقروطة

كود :
Function Shape_Bounds(Btn: TButton; Polygon_Elliptic: Byte): Integer;
var
P: array[1..4]of TPoint;
begin
with Btn do
begin
case Polygon_Elliptic of
0:
begin
P[1].X := Round(ClientWidth / 2);
P[1].Y := 0;
P[2].X := 0;
P[2].Y := Round(ClientHeight / 2);
P[3].X := Round(ClientWidth / 2);
P[3].Y := ClientHeight;
P[4].X := ClientWidth;
P[4].Y := Round(ClientHeight / 2);
Result := CreatePolygonRgn(P, 4, POLYFILL_LAST);
end;
1: Result := CreateEllipticRgn(0, 0, Width, Height);
end;
SetWindowRgn(Handle, Result, True);
end;
end;[/PHP]
[PHP]
procedure TForm1.btn3Click(Sender: TObject);
begin
Shape_Bounds(btn1, 0); //دائرة
Shape_Bounds(btn2, 1); //مقروطى
end;
