by Martin Sykes (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
The easyiest and most modifiable way to change a forms shape, instead of the boring windows square.
API Declarations
'______________________________________________
'|//Please Visit: http://getdownloads.s5.com\\|'
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode 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 Type POINTAPI
x As Long
y As Long
End Type
Private mRegion As Long
Public Sub MakeTreeShaped()
Dim new_shape() As POINTAPI
ReDim new_shape(0 To 11) As POINTAPI
'\\ Start at top...
'_____________________
'| |_
' \_____________________| This module is for makeing the form <<-This shape
Dim i
With frm_PBar7
new_shape(i).x = 0: new_shape(i).y = 0: i = i + 1
new_shape(i).x = (.Width / 15) - 16: new_shape(i).y = 0: i = i + 1
new_shape(i).x = (.Width / 15) - 16: new_shape(i).y = 16: i = i + 1
new_shape(i).x = (.Width / 15): new_shape(i).y = 16: i = i + 1
new_shape(i).x = (.Width / 15): new_shape(i).y = (.Height / 15): i = i + 1
new_shape(i).x = 16: new_shape(i).y = (.Height / 15): i = i + 1
new_shape(i).x = 0: new_shape(i).y = (.Height / 15) - 16: i = i + 1
End With
'\\ Create this polygon region
mRegion = CreatePolygonRgn(new_shape(0), 12, 1)
Dim lret As Long
lret = SetWindowRgn(frm_PBar7.hwnd, mRegion, True)
End Sub
No comments have been posted about The easyiest and most modifiable way to change a forms shape, instead of the boring windows square.. Why not be the first to post a comment about The easyiest and most modifiable way to change a forms shape, instead of the boring windows square..