角が丸い矩形の領域を作成する
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