VB Code:
Option Explicit
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 SetWindowRgn Lib "user32" _
(ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub MakeRound(frm As Form)
Dim lngNewWnd As Long
Dim lngNewRgn As Long
Dim lngWidth As Long
Dim lngHeight As Long
' Calculate the current width
lngWidth = frm.Width / Screen.TwipsPerPixelX
' Calculate the current height
lngHeight = frm.Height / Screen.TwipsPerPixelY
' Create the new region
lngNewWnd = CreateRoundRectRgn(0, 0, Me.Width, Me.Height, 2, 2)
lngNewRgn = SetWindowRgn(frm.hWnd, lngNewWnd, True)
'/ Screen.TwipsPerPixelX + 1
' / Screen.TwipsPerPixelY + 1
End Sub
Private Sub Form_Load()
lblComponent(0).BackColor = lngMenuColor
MakeRound Me
frmMain.Width = frmMain.imgBackGround.Width
frmMain.Height = frmMain.imgBackGround.Height
End Sub