Delphi 재작성 컨트롤의 예

1669 단어 Delphi
unit   DBGridEx;
  interface
  uses    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,    Grids, DBGrids;
  type    TMyInplaceEdit =  class (TInplaceEdit)    published      property   Color;    end ;
     TMyDBGrid =  class (TDBGrid)    protected      function   CreateEditor: TInplaceEdit; override;    end ;
  procedure   Register;
  implementation
  procedure   Register; begin    RegisterComponents( 'Standard' , [TMyDBGrid]); end ;
  function   TMyDBGrid . CreateEditor: TInplaceEdit; var     aEdit: TMyInplaceEdit; begin    aEdit := TMyInplaceEdit . Create(Self);    aEdit . Color := clGreen;   //    Result := aEdit; end ;
  end .

좋은 웹페이지 즐겨찾기