Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleMake an elliptical ActiveX picture control
Keywordselliptical control, ActiveX control, picture control
CategoriesControls, ActiveX Controls, ActiveX, Graphics
 
In the UserControl's Resize event handler, use the CreateEllipticRgn, SetWindowRgn, and DeleteObject API functions to restrict the control to an elliptical region.
 
' Give the control an elliptical region.
Private Sub UserControl_Resize()
Dim rgn As Long
Dim wid As Single
Dim hgt As Single

    ' Create the elliptical region.
    wid = ScaleX(Width, vbTwips, vbPixels)
    hgt = ScaleY(Height, vbTwips, vbPixels)
    rgn = CreateEllipticRgn(0, 0, wid, hgt)

    ' Restrict the window to the region.
    SetWindowRgn hWnd, rgn, True
    DeleteObject rgn
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated