View Issue Details

IDProjectCategoryView StatusLast Update
0014546LazarusLCLpublic2011-10-28 09:57
ReporterSven Barth Assigned ToJesus Reyes  
Status resolvedResolutionnot fixable 
Product Version0.9.26.3 (SVN) 
Fixed in Version0.9.31 (SVN) 
Summary0014546: ClientWidth in TDrawGrid is first equal to Width and later to "real" ClientWidth
DescriptionOn start of an application with a TDrawGrid (ScrollBars=ssVertical) the grid's ClientWidth is equal to its Width (in attached example 224 pixels). When I change ScrollBars property to ssNone the ClientWidth is set to a different width (220). Activating the vertical scrollbar (ScrollBars=ssVertical) again, results in the width of the real client area (203).

I believe ClientHeight will behave the same way.
Additional InformationI only checked this on Win32 so far. In WinCE I have to face another bug with scrollbar visibility ^^
Fixed in Revision
Attached Files


related to 0014548 closedFelipe Monteiro de Carvalho WinCE: TDrawGrid's scrollbars are not shown or hidden 


2009-09-09 12:23 (157,543 bytes)

Jesus Reyes

2011-10-28 09:57

developer   ~0053539

When the object creation stage has finished the OnCreate form event is triggered, at this time all childs are already created but their window handles are not yet ready, and it seems getting the real clientwidth is not reliable until all window handles are created. I don't know if this is particular to Lazarus or this behaviour is delphi compatible.

A more reliable place to get childs clientwidth is OnShow form event, I moved the UpdateLabel call there and it shows the expected clientwidth 203.

In any case I think this is not a particular problem of grids but a general behaviour for all components that have a handle.

Issue History

Date Modified Username Field Change
2009-09-09 12:23 Sven Barth New Issue
2009-09-09 12:23 Sven Barth File Added:
2009-09-09 12:23 Sven Barth Widgetset => Win32/Win64
2009-09-09 13:25 Vincent Snijders LazTarget => 1.0
2009-09-09 13:25 Vincent Snijders Assigned To => Jesus Reyes
2009-09-09 13:25 Vincent Snijders Status new => assigned
2009-09-09 13:25 Vincent Snijders Target Version => 1.0.0
2010-03-15 03:54 Jesus Reyes Tag Attached: grids
2010-05-28 09:32 Felipe Monteiro de Carvalho Relationship added related to 0014548
2011-04-04 05:35 Paul Ishenin LazTarget 1.0 => 0.99.0
2011-04-04 05:38 Paul Ishenin Target Version 1.0.0 => 0.99.0
2011-10-02 17:42 Felipe Monteiro de Carvalho LazTarget 0.99.0 => 1.0
2011-10-28 09:57 Jesus Reyes Status assigned => resolved
2011-10-28 09:57 Jesus Reyes Fixed in Version => 0.9.31 (SVN)
2011-10-28 09:57 Jesus Reyes Resolution open => not fixable
2011-10-28 09:57 Jesus Reyes Note Added: 0053539