CreateRoundRectRgn

機能
角が丸い矩形の領域を作成する
Declare Function CreateRoundRectRgn Lib "GDI32.dll" _
(ByVal nLeft As Long, ByVal nTop As Long, _
ByVal nRight As Long, ByVal nBotomm As Long, _
nWidthEllipse As Long, nHeightEllipse As Long) As Long
Declare Function CreateRoundRectRgn Lib "GDI32.dll" _
(ByVal nLeft As Integer, ByVal nTop As Integer, _
ByVal nRight As Integer, ByVal nBotomm As Integer, _
nWidthEllipse As Integer, nHeightEllipse As Integer) As Integer

HRGN CreateRoundRectRgn(
int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect,
int nWidthEllipse,
int nHeightEllipse
);
引数
nLeft

矩形の左上隅のハンドル
nTop
同、Y座標
nRight
同、右下隅のX座標
nBottom
同、Y座標
nWidthEllipse
コーナー部を構成する楕円を包含する領域の幅
nHeightEllipse
同、高さ
戻り値
成功したとき            矩形領域のハンドル
失敗したとき            0
サンプル
ダウンロード(CreateRoundRectRgn.lzh 1.47KB)

Private Sub Command1_Click()
Dim hRgn As Long

Me.FillColor = vbBlue
Me.FillStyle = vbCross
hRgn = CreateRoundRectRgn(0, 20, 520, 90, 10, 10)
Call PaintRgn(Me.hdc, hRgn)
Call DeleteObject(hRgn)
End Sub