Add a size grid to VB form
Add a size grid to VB form
API Declarations
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : [email protected]
' * Date : 13/10/98
' * Time : 10:24
' * Module Name : Form_Module
' * Module Filename : Form.bas
' **********************************************************************
' * Comments :
' * Add a size grid to VB form
' **********************************************************************
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function DrawFrameControl Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Const DFCS_SCROLLSIZEGRIP = &H8
Private Const DFC_SCROLL = 3
Rate Add a size grid to VB form
(2(2 Vote))
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : [email protected]
' * Date : 13/10/98
' * Time : 10:24
' * Module Name : Form_Module
' * Module Filename : Form.bas
' **********************************************************************
' * Comments :
' * Add a size grid to VB form
' **********************************************************************
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Form_Resize()
Dim rct As RECT
On Error Resume Next
'This is necessary as the form could be made too small
'for the controls. This could be overcome by adding some
'code to handle this eventuality.
'reposition/resize the controls
cmdClose.Left = ScaleWidth - (cmdClose.Width + (8 * Screen.TwipsPerPixelX))
With List1
.Width = ScaleWidth - (cmdClose.Width + (24 * Screen.TwipsPerPixelX))
.Height = ScaleHeight - (16 * Screen.TwipsPerPixelY)
End With
Cls
'Draw the size grip
GetClientRect Me.hwnd, rct
With rct
.Left = .Right - 17
.Top = .Bottom - 17
DrawFrameControl Me.hdc, rct, DFC_SCROLL, DFCS_SCROLLSIZEGRIP
End With
End Sub
Add a size grid to VB form Comments
No comments yet — be the first to post one!
Post a Comment