Groups > Borland > Borland Turbo C plus plus > Re: StringGrid: help for center auto center Col




StringGrid: help for center auto center Col

StringGrid: help for center auto center Col
Sat, 14 Apr 2007 09:14:37 GMT
Hi,
when I resize my col in StringGrid, the new resized-col is not join to 
right border!
Example:
http://digilander.libero.it/ciccio.unico/1.jpg
Post Reply
Re: StringGrid: help for center auto center Col
17 Apr 2007 04:02:45 -0800
Ciccio <ciccio.unico@libero.itTOGLIMI> wrote in
news:1Y0Uh.7181$uJ5.120425
@twister2.libero.it:

> Hi,
> when I resize my col in StringGrid, the new resized-col is not join to 
> right border!
> Example:
> http://digilander.libero.it/ciccio.unico/1.jpg
> I can do automatic align at right border? Thanks
> 

Are you resizing the column at runtime?

If so then you should adjust the property ColWidths[<N>] where N is the 
column you wish to adjust (0 -> N from left to right).
This can be a bit troublesome due to the fact you need to pay attention to 
the property ClientWidth and subtract the property GridLineWidth for each 
non fixed column from it and all your column widths before the right most 
column if you want it flush with the right edge of the controls client area 
all the time.

If you aren't doing this at run time consider the possibility that 
everything might get moved around and do it at run time instead.  I update 
ColWidths[] ussually during a resize event for the control that contains 
the StringGrid.  Also note StringGrids are VERY limited in size.  Do not 
use them if you need a very large number of rows (anything greater than 
65525). I would suggest using a DrawGrid and draw the area yourself if you 
need greater than that number.

Post Reply
Re: StringGrid: help for center auto center Col
Tue, 17 Apr 2007 12:21:35 GMT
Stephen Phillips ha scritto:

> Are you resizing the column at runtime?
> 
> If so then you should adjust the property ColWidths[<N>] where N is
the 
> column you wish to adjust (0 -> N from left to right).
> This can be a bit troublesome due to the fact you need to pay attention to

> the property ClientWidth and subtract the property GridLineWidth for each 
> non fixed column from it and all your column widths before the right most 
> column if you want it flush with the right edge of the controls client area

> all the time.
> 
> If you aren't doing this at run time consider the possibility that 
> everything might get moved around and do it at run time instead.  I update

> ColWidths[] ussually during a resize event for the control that contains 
> the StringGrid.  Also note StringGrids are VERY limited in size.  Do not 
> use them if you need a very large number of rows (anything greater than 
> 65525). I would suggest using a DrawGrid and draw the area yourself if you

> need greater than that number.
Post Reply
about | contact