在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
procedure TForm1.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); //缩小R 5 Perform(EM_SETRECTNP, 0, LParam(@R)); //消息等于EM_SETRECT,但是不会发生重绘事件 SetWindowRgn(Control.Handle, Rgn, True); Invalidate; {------------- Perform(EM_SETRECT, 0, LParam(@R)); ----------------------} end; //传入控件的name和两个弧度就可以设置控件的圆角效果 end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论