Board index » cppbuilder » StringGrid: help for center auto center Col

StringGrid: help for center auto center Col


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

Re:StringGrid: help for center auto center Col

Ciccio < XXXX@XXXXX.COM >wrote in news:1Y0Uh.7181$uJ5.120425
@twister2.libero.it:
Quote
Hi,
when I resize my col in StringGrid, the new resized-col is not join to
right border!
Example:
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.
Stephen
 

Re:StringGrid: help for center auto center Col

Stephen Phillips ha scritto:
Quote
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.
Good! Thanks a lot for your advice! ;-)
 

{smallsort}