Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
Option Explicit Public Sub ClearGrid(GrdName As Control) With GrdName .FixedRows = 0 .Rows = 1 .Rows = 2 .FixedRows = 1 End With End Sub Public Sub SizeGrid(GrdName As Control, vCols As Integer, vRows As Integer, vScrollSize As Integer) Dim iCol As Integer Dim iRow As Integer 'Set grid width and height With GrdName .Width = 0 .Height = 0 If .Cols > vCols Then .Height = .Height + vScrollSize Else vCols = .Cols End If If .Rows > vRows Then .Width = .Width + vScrollSize Else vRows = .Rows End If For iCol = 0 To (vCols - 1) .Width = .Width + .ColWidth(iCol) Next iCol If .GridLines Then .Width = .Width + (.GridLineWidth * iCol * Screen.TwipsPerPixelX) End If For iRow = 0 To vRows - 1 .Height = .Height + .RowHeight(iRow) Next iRow If .GridLines Then .Height = .Height + (.GridLineWidth * iRow * Screen.TwipsPerPixelY) End If End With End Sub

Mail To: info@3pc.com