Visual Basic > Code Snippets
Rectangular form example
Rectangular form example 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 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 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 nhwnd = CreateRectRgn(0, 0, fwidth / 2, fheight / 2) rval = SetWindowRgn(Me.hWnd, nhwnd, True) rval = DeleteObject(nhwnd) End Sub
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows