|
|
Title | Make an elliptical ActiveX picture control |
Keywords | elliptical control, ActiveX control, picture control |
Categories | Controls, 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
|
|
|
|
|
|