Board index » delphi » TStringGrid and GridWidth

TStringGrid and GridWidth

I have a TStringGrid with 3 columns. The grid sits on a TTabsheet in a
TPageControl. I'm trying to figure out how to adjust the width of the 3rd
column based on the current width of the grid. I'm looking at the GridWidth
property.  The grid's Align property is set to clClient so that when the
form is maximized all components including the grid will maximize.  I was
thinking that the GridWidth should change if the actual size of the grid
changes due to maximizing the form.  This doesn't seem to be the case. I was
planning to subtracting the width of the first two columns plus the width of
the vertical scroll bar from the GridWidth to get the width of the 3rd
column.

Does anyone have a useful suggestion on this?

Thanks

 

Re:TStringGrid and GridWidth


As usual it way works. I'm using Width property of String grid to define the
width.
Quote
Ken McClain wrote:
> I have a TStringGrid with 3 columns. The grid sits on a TTabsheet in a
> TPageControl. I'm trying to figure out how to adjust the width of the 3rd
> column based on the current width of the grid. I'm looking at the GridWidth
> property.  The grid's Align property is set to clClient so that when the
> form is maximized all components including the grid will maximize.  I was
> thinking that the GridWidth should change if the actual size of the grid
> changes due to maximizing the form.  This doesn't seem to be the case. I was
> planning to subtracting the width of the first two columns plus the width of
> the vertical scroll bar from the GridWidth to get the width of the 3rd
> column.

> Does anyone have a useful suggestion on this?

> Thanks

Other Threads