rectangular form example
August 16, 2008 by admin
Filed under Visual Basic
this example shows how to create a rectangular form in Visual basic
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
Related posts:
- Screen capture Screen capture using Visual Basic Private Declare Sub keybd_event Lib...
- show amount of lines in a multi line textbox Public Declare Function SendMessageLong Lib “user32″ Alias “SendMessageA” (ByVal hwnd...
- Get screen resolution with Visual Basic This Visual Basic example will find out your current screen...
- beep Private Declare Function Beep Lib “kernel32″ _ (ByVal dwFreq As...
- change drive name Private Declare Function SetVolumeLabelA Lib “kernel32″ _ (ByVal lpRootPathName As...
Related posts brought to you by Yet Another Related Posts Plugin.






















