I like to display data in a table - without scrollbars for a clean display. I want to set the table height to display all the rows without a scroll bar and without excess space at the bottom (between the last row and the bottom of the table control).
The problem is that both the header height and the row height varies according to font size and varies from IDE to QVGA to VGA devices. For example, with a font size of 9 the header heights are 24 (IDE), 21 (QVGA), or 22 (VGA). The Row heights are 18 (IDE), 19 (QVGA), or 19.5 (VGA).
It was a bit tedious, but I figured out the header and row heights for font sizes of 6, 7, 8, 9, 10, 11, and 12 for all three platforms (IDE, QVGA, and VGA). Given these values, if H is the header size for a given font, and R is the row size for that font, the optimum table height can be calculated as
Table1.Height = H + Int(Table1.RowCount * R)
The attached program provides the 36 values, and illustrates how the table height can be kept optimum when adding or subtracting rows, or when changing font sizes. Compile with autoscale for use on VGA devices.
Or am I the only one this fussy?
The problem is that both the header height and the row height varies according to font size and varies from IDE to QVGA to VGA devices. For example, with a font size of 9 the header heights are 24 (IDE), 21 (QVGA), or 22 (VGA). The Row heights are 18 (IDE), 19 (QVGA), or 19.5 (VGA).
It was a bit tedious, but I figured out the header and row heights for font sizes of 6, 7, 8, 9, 10, 11, and 12 for all three platforms (IDE, QVGA, and VGA). Given these values, if H is the header size for a given font, and R is the row size for that font, the optimum table height can be calculated as
Table1.Height = H + Int(Table1.RowCount * R)
The attached program provides the 36 values, and illustrates how the table height can be kept optimum when adding or subtracting rows, or when changing font sizes. Compile with autoscale for use on VGA devices.
Or am I the only one this fussy?