1个回答
展开全部
请用 API 函数 RoundRect。
例子(点击窗体,画圆角矩形):
Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Sub Form_Click()
Call RoundRect(Me.hdc, 10, 10, 110, 110, 10, 10)
End Sub
参数:
hdc 设备上下文。比如 Me.hDC,Picture1.hDC就可以。
X1,Y1 左上角
X2,Y2 右下角
X3,Y3 圆角内偏移(即圆角半径,0表示直角)
上面的坐标什么的都以像素计,不同于VB默认的Twip
例子(点击窗体,画圆角矩形):
Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Sub Form_Click()
Call RoundRect(Me.hdc, 10, 10, 110, 110, 10, 10)
End Sub
参数:
hdc 设备上下文。比如 Me.hDC,Picture1.hDC就可以。
X1,Y1 左上角
X2,Y2 右下角
X3,Y3 圆角内偏移(即圆角半径,0表示直角)
上面的坐标什么的都以像素计,不同于VB默认的Twip
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询