unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ExtCtrls, Buttons;type TForm1 = class(TForm)Image1: TImage;SpeedButton1: TSpeedButton;procedure FormCreate(Sender: TObject);procedure SpeedButton1Click(Sender: TObject);private{ Private declarations }procedure CreateParams(var Params: TCreateParams); override;public{ Public declarations }end;var Form1: TForm1;implementation procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited createparams(params); {Здесь убираем у формы заголовки и границы} params.style:=params.style or ws_popup xor ws_dlgframe; end; {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); var formrgn:hrgn; begin {очищаем форму} form1.brush.style:=bsclear; {делаем форму круглой} GetWindowRgn(form1.Handle, formRgn); DeleteObject(formRgn);formrgn:=CreateroundRectRgn(0,0,form1.width,form1.width,form1.width,form1.width); SetWindowRgn(form1.Handle, formrgn, TRUE);end; procedure TForm1.SpeedButton1Click(Sender: TObject); begin form1.close; end; end. |
[000106]