Declare Function RoundRect Lib "gdi32.dll" (ByVal hdc As Long, X1 As Long, Y1 As Long, X2 As Long, Y2 As Long, X3 As Long, Y3 As Long) As Long
RoundRect draws a rectangle with rounded corners on a graphics-capable device. It is drawn in the color of the object's .ForeColor property. The first two (x,y) coordinate pairs specified are the upper-left and lower-right corners a square-cornered rectangle. The third pair specifies the width and height of the rounded corner to use. The function returns 0 if an error occured, or a non-zero value if successful.
Example:
' Draw a rounded rectangle with rounded corners 10 wide and 5 high
' The rectangle goes from (10,10)-(150,150) and is blue
Picture1.ForeColor = RGB(0, 0, 255) ' blue
x = RoundRect(Picture1.hDC, 10, 10, 150, 150, 10, 5)
Related Call: Rectangle
Category: Graphics
Back to the index.