Form - Janela redonda

Top  Previous  Next

  private

    IsRound : Boolean;

 

procedure TForm1.FormClick(Sender: TObject);

var

  R : HRgn;

begin

  if IsRound then

    begin

      SetWindowRgn(Handle,0,True);

      DeleteObject(R);

      IsRound := False;

    end

  else

    begin

      R := CreateEllipticRgn(-10,-10,Width+10,Height+10);

      SetWindowRgn(Handle,R,True);

      IsRound := True;

    end;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  IsRound := False;

end;