Board index » delphi » TStringGrid Column Resizing Event?

TStringGrid Column Resizing Event?

Does anyone know what event is triggered when StringGrid columns are resized
using a mouse? I am trying to capture the new ColsWidth after the change and
can't seem to find the right approach. (I can recognize when a column is
moved by using the OnColumnMoved event but this doesn't seem to happen when
resizing occurs.) What am I missing?

TIA for any help.

Tom

 

Re:TStringGrid Column Resizing Event?


Thank you! Great idea!

Tom

"Rick Rogers (TeamB)" <r...@fenestra.com> wrote in message
news:vniuas4ep5l3scnne0s9vh9htlbaah89j5@4ax.com...

Quote
> On Sat, 19 Feb 2000 08:30:22 -0500, "Tom Hahn" <th...@hahntech.com>
> wrote:

> > Does anyone know what event is triggered when StringGrid
> > columns are resized using a mouse?

> No event, but you can create a TStringGrid descendant and override the
> virtual ColWidthsChanged method. You could even create on
> OnColWidthsChanged event in your descendant, like this:

> type
>   TTomGrid = class(TStringGrid)
>   private
>     FOnColWidthsChanged: TNotifyEvent;
>   protected
>     procedure ColWidthsChanged; override;
>   published
>     property OnColWidthsChanged: TNotifyEvent
>       read FOnColWidthsChanged write FOnColWidthsChanged;
>   end;

> implementation

> procedure TTomGrid.ColWidthsChanged;
> begin
>   inherited;
>   if Assigned(FOnColWidthsChanged) then
>     FOnColWidthsChanged(Self);
> end;

Other Threads