许多现代应用程序都有形状不规则的表单。在Delphi中做这件事的最好方法是什么?是否可以在不使用任何第三方VCLs的情况下完成此操作?
发布于 2010-08-26 13:59:09
可以,您必须使用SetWindowRgn函数来设置要绘制的新窗口区域。
试试这段代码
procedure TForm1.FormCreate(Sender: TObject);
var
region:HRGN;
begin
region := CreateRoundRectRgn(ClientRect.left, ClientRect.top, ClientRect.right, ClientRect.bottom, 15, 15);
SetWindowRgn(Handle, region, true);
end;

有关更多信息,请查看这些链接
发布于 2010-08-26 18:00:55
您可以使用TForms的TransparentColorValue属性。与BorderStyle=bsNone相结合,它将为您提供这样的形状。
https://stackoverflow.com/questions/3572342
复制相似问题