You create every component the same way: create a unit, derive a component class, register it, compile it, and install it on the Tool palette. This process is outlined in Creating a new component.
For this example, follow the general procedure for creating a component, with these specifics:
unit CalSamp; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Grids; type TSampleCalendar = class(TCustomGrid) end; procedure Register; implementation procedure Register; begin RegisterComponents('Samples', [TSampleCalendar]); end; end.
If you install the calendar component now, you will find that it appears on the Samples page. The only properties available are the most basic control properties. The next step is to make some of the more specialized properties available to users of the calendar.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|