[Lazarus] Fitting a form around a grid

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Jun 16 15:53:04 CEST 2011


Mark Morgan Lloyd schrieb:
> It's obviously easy enough to fit a grid into the client space of a form 
> or panel, but how does one do the reverse?
> 
> The exact size of a grid (i.e. such that the outermost grid lines are 
> either displayed or not displayed predictably) depends on the widget 
> set, and possibly on other details such as fount metrics, screen DPI and 
> so on. At present I find myself applying "fudge factors" when shrinking 
> a form to be an exact fit around a grid of a predetermined number of 
> rows and columns, and that's still not entirely reliable when moving 
> between systems.
> 
> Is there a "correct" way of doing this?

If you don't want to calculate the exact amount, you can dimension the 
form sufficiently big, and adjust the columns to fill the form.

DoDi





More information about the Lazarus mailing list