Here's my current (final?) version. I've made a few minor changes (value of row 4) and fixed scrolling problems. I have set the grid width as:
Depending on the total grid width (play around with the number of extra pixels) some problems appear with scrolling. It appears that you need 2 extra pixels so that the rightmost visible column is considered totally visible, but then another pixel may be necessary to prevent unwanted scrolling effects (try and see).VB Code:
tx = Screen.TwipsPerPixelX With Grid 'Sum of the widths of all the columns (all have the same ' width) plus the widths of the left and 'right borders '(times 2, found by trial and error) .Width = .ColWidth(0) * nVisibleCols + 4 * .BorderStyle * tx 'And I have added 3 extra pixels (see below) .Width = .Width + 3 * tx End With
All in all I have the feeling that I'm on shaky ground and that the whole thing is a mess.




Reply With Quote