'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API
'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API
API Declarations
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Rate 'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API
(2(2 Vote))
'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim fwidth As Long, fheight As Long
Dim rval As Long, nhwnd As Long
fwidth = Me.Width / Screen.TwipsPerPixelX
fheight = Me.Height / Screen.TwipsPerPixelY
'Create Round Rectangular Region
nhwnd = CreateRoundRectRgn(0, 0, fwidth - 25, fheight - 25, fwidth - 50, fheight - 50)
'Create Elliptic Region
'nhwnd = CreateRoundRectRgn(0, 0, fwidth - 50, fheight - 50, fwidth - 50, fheight - 50)
'Set Round Rectangular Region on form
rval = SetWindowRgn(Me.hWnd, nhwnd, True)
rval = DeleteObject(nhwnd)
End Sub
'Create a Round Rectangular Form using CreateRoundRectRgn and SetWindowRgn API Comments
No comments yet — be the first to post one!
Post a Comment