Shaped Form

Create a form, copy and paste the following code there:

____________________________________________________________________

Option Explicit
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
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 CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Const RGN_COPY = 5
Private Const CreatedBy = "VBSFC 6.2"
Private Const RegisteredTo = "Not Registered"
Private ResultRegion As Long
Private Function CreateFormRegion(ScaleX As Single, ScaleY As Single, OffsetX As Integer, OffsetY As Integer) As Long
Dim HolderRegion As Long, ObjectRegion As Long, nRet As Long, Counter As Integer
Dim PolyPoints() As POINTAPI
ResultRegion = CreateRectRgn(0, 0, 0, 0)
HolderRegion = CreateRectRgn(0, 0, 0, 0)

'This procedure was generated by VB Shaped Form Creator. This copy has
'NOT been registered for commercial use. It may only be used for non-
'profit making programs. If you intend to sell your program, I think
'it's only fair you pay for mine. Commercial registration costs $30,
'and can be performed online. See "Registration" item on the help menu
'for details.

'Latest versions of VB Shaped Form Creator can be found at my website at
'http://www.comports.com/AlexV/VBSFC.html or you can visit my main site
'with many other free programs and utilities at http://www.comports.com/AlexV

'Lines starting with '! are required for reading the form shape using the
'Import Form command in VB Shaped Form Creator, but are not necessary for
'Visual Basic to display the form correctly.

'!Shaped Form Region Definition
'!2,45,57,251,193,33,30,1
ObjectRegion = CreateRoundRectRgn(57 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 45 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, 251 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 193 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, 66 * ScaleX * 15 / Screen.TwipsPerPixelX, 60 * ScaleY * 15 / Screen.TwipsPerPixelY)
nRet = CombineRgn(ResultRegion, ObjectRegion, ObjectRegion, RGN_COPY)
DeleteObject ObjectRegion
'!3,65,213,275,127,0,0,1
ObjectRegion = CreateEllipticRgn(213 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 65 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, 275 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 127 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY)
nRet = CombineRgn(HolderRegion, ResultRegion, ResultRegion, RGN_COPY)
nRet = CombineRgn(ResultRegion, HolderRegion, ObjectRegion, 2)
DeleteObject ObjectRegion
'!3,142,104,204,242,0,0,1
ObjectRegion = CreateEllipticRgn(104 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 142 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY, 204 * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX, 242 * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY)
nRet = CombineRgn(HolderRegion, ResultRegion, ResultRegion, RGN_COPY)
nRet = CombineRgn(ResultRegion, HolderRegion, ObjectRegion, 2)
DeleteObject ObjectRegion
DeleteObject HolderRegion
CreateFormRegion = ResultRegion
End Function

Private Sub Form_Load()
Dim nRet As Long
nRet = SetWindowRgn(Me.hWnd, CreateFormRegion(1, 1, 0, 0), True)
'If the above two lines are modified or moved a second copy of
'them may be added again if the form is later Modified by VBSFC.
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Next two lines enable window drag from anywhere on form. Remove them
'to allow window drag from title bar only.
ReleaseCapture
SendMessage Me.hWnd, &HA1, 2, 0&
End Sub
Private Sub Form_Unload(Cancel As Integer)
DeleteObject ResultRegion
'If the above line is modified or moved a second copy of it
'may be added again if the form is later Modified by VBSFC.
End Sub