The TMetroPanel class has a bug that prevents tiles from wrapping correctly. The maximum number of columns of tiles in a group should be three large tiles (this could be a combination of large and small tiles). Sometimes the columns exceed this by a half a large tile (width of a small tile) so you have the equivalent of 3 and a half large tiles. Whew I hope that was clear.
Here is the fix. In the Arrange() method add the line shown below:
Method Arrange () CLASS TMetroPanel
...
nCols := Ceiling( nBtns / ::nMetroRows ) // existing line
nCols := min( nCols, 5 ) // add this line
I don't quit understand what the ceiling function does, but adding the new line seems to fix the bug.
Or, I suppose you could do this instead:
nCols := min( Ceiling( nBtns / ::nMetroRows ), 5 )
Is there documentation on the ceiling function or which source code file is it in?
Regards,
James