|
|
Title | Draw a rounded rectangle |
Description | This example shows how to draw a rounded rectangle in Visual Basic 6 by using the RoundRect API function. |
Keywords | rounded rectangle, RoundRect |
Categories | API, Graphics |
|
|
The program uses the RoundRect API function. The first four parameters give the coordinates of the rectangle's upper left and lower right corners. The last two parameters give the width and height of an ellipse that defines the corner rounding. Note that a corner essentially uses a quarter of the ellipse so the rounded parts are half as wide and tall as the ellipse.
Note also that API functions always measure in pixels.
|
|
Private Sub Form_Load()
Me.AutoRedraw = True
RoundRect Me.hdc, 50, 50, 250, 150, 50, 50
End Sub
|
|
|
|
|
|