VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Creates a Rounded Rectangular Form.

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

Rate Creates a Rounded Rectangular Form.




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


Download this snippet    Add to My Saved Code

Creates a Rounded Rectangular Form. Comments

No comments have been posted about Creates a Rounded Rectangular Form.. Why not be the first to post a comment about Creates a Rounded Rectangular Form..

Post your comment

Subject:
Message:
0/1000 characters