[Lazarus] TsWorkshetGrid isn't scrolling enough

Werner Pamler werner.pamler at freenet.de
Wed Apr 6 20:52:08 CEST 2016


Am 06.04.2016 um 19:34 schrieb Frans:
> Hi.
>
> Your demo works fine, so I will change my program.
> I've noticed another point: on my computer is the fontsize and the row 
> heigth greater in my program than in your demo.
> I've tried changing the fontsize, in the object inspector and in the 
> code, but that makes no difference.
>
> I use this code in a much bigger program where also TStringGrids are 
> used. There too is the fontsize bigger for the worksheetgrid then in 
> the StringGrids. Why? I do not know.

So you are saying that the StringGrid scrolls correctly, the 
WorksheetGrid does not? No good for the WorksheetGrid, and hard to debug 
because I cannot reproduce the error...

Font size and row heights of the WorksheetGrid are controlled by 
settings in the file, not by Grid properties. Add the following lines to 
your code in Formshow after LoadfromSpreadsheetFile:

   sWorksheetGrid1.Workbook.SetDefaultFont('Calibri', 10);   // font 
name and font size in pts.
   sWorksheetGrid1.Worksheet.DefaultRowHeight := 1.0;   // units are lines

and play with the values to see if there are combinations for with the 
scrolling issue disappears. (The currently used value are DefaultFont = 
'Arial', 10-pt and DefaultRowHeight = 1.2)




More information about the Lazarus mailing list