: Help creating new component from TDBGrid

I need some help modifying TDBGird. I guess my main problem is that this
is the first time I've tried modifying any of the components that come
with Delphi. Reading Borland's Component Writers Guide, it seemed so simple
to achive what I want, but I'm having problems getting started.

Basically, I just wanted to publish the ColWidths property of TDBGrid so
that I could manually control column widths of a DBGrid from within my

Looking in the Object Browser, I discovered that ColWidths is an inherited,
protected property (I think this is what all those colors and letters mean).
The Component Writers Guide says: "To make a protected ... property available
.. you must redeclare the property as published." It goes on to state that
you must declare the property in the published section of the new component.
I think I followed Borland's example exactly, but when I compile I get an
error message (error #202) that says that ColWidths property cannot be

I then tried placing the 'property ColWidths;' statement in the public
section of the new component. I compiled OK, but when I tried to set a
column width at run time it didn't work (although, other previously available
properties of TDBGrid like DataSource work just fine with my new type).

What am I doing wrong? I've even tried going "back up" the object tree a
couple of ancestors and I can't get it to work (although I'd prefer not to
go up since TDBGrid is exactly what I want, except with ColWidths).

Here is a bit of my code.

Thanks VERY MUCH for any help.

Greg Couch
unit Unit2;


  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, Grids, DBGrids;

  TDBGridHide = class(TDBGrid)
    property ColWidths;

procedure Register;


procedure Register;
  RegisterComponents('MyPage', [TDBGridHide]);