by Bird (7 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 23rd June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Creates a Rounded Rectangular Form.
API Declarations
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Sub RoundRect(ByVal uObject As Object, ByVal v As Long, ByVal w As Long)
Dim lRight As Long
Dim lBottom As Long
Dim hRgn As Long
With uObject
lRight = .Width / Screen.TwipsPerPixelX
lBottom = .Height / Screen.TwipsPerPixelY
hRgn = CreateRoundRectRgn(0, 0, lRight, lBottom, v, w)
SetWindowRgn .hWnd, hRgn, True
End With
End Sub
Private Sub Form_Load()
RoundRect Me, 40, 40 'Leave it on 40.
End Sub