Delphi 使控件变成圆角的方法


本文整理自网络,侵删。

 
procedure  RoundControl(Control: TWinControl; arc1, arc2: Integer);
var
  R: TRect;
  Rgn: HRGN;
begin
  with Control do
  begin
    R := Control.ClientRect;
    Rgn := CreateRoundRectRgn(R.Left, R.Top, R.Right, R.Bottom, arc1, arc2);
    Perform(EM_GETRECT, 0, lParam(@R));
    InflateRect(R, -5, -5);
    Perform(EM_SETRECTNP, 0, lParam(@R));
    SetWindowRgn(Control.Handle, Rgn, True);
    Invalidate;
  end;
end;

相关阅读 >>

Delphi 2009 之 tcategorypanelgroup[5]: headerstyle

Delphi xe7组件tetheringmanager1发送消息

Delphi 存储文件到数据库

Delphi版本号检测判断

Delphi tstream详解

Delphi winapi: writeprivateprofilestring、getprivateprofilestring - 简单读写 ini 文件

Delphi edit只能输入数字或小数点

Delphi fdmemtable1内存表字段排序

Delphi getfilehashmd5获取文件 hashmd5值

Delphi逐个读取access中的数据

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...