Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleDraw a rounded rectangle
DescriptionThis example shows how to draw a rounded rectangle in Visual Basic 6 by using the RoundRect API function.
Keywordsrounded rectangle, RoundRect
CategoriesAPI, 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated