Visual Basic > Code Snippets
Create a round form
Create a round form Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long Private Sub Form_Load() Dim lngRegion As Long Dim lngReturn As Long Dim lngFormWidth As Long Dim lngFormHeight As Long lngFormWidth = Me.Width / Screen.TwipsPerPixelX lngFormHeight = Me.Height / Screen.TwipsPerPixelY lngRegion = CreateEllipticRgn(0, 0, lngFormWidth, lngFormHeight) lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True) End Sub
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows