我的没这问题呀.是不是你的包含单元的问题.在自定义控件中就少了一些包含单元.那也不对呀.那样的话你连编译也不会过去的...
unit MEdits;
interface
uses
SysUtils, Classes, Controls, Stdctrls, Windows, messages,
Graphics, Forms, Dialogs,
ExtCtrls;
type
TGlassStyle = (
gsBlackness, gsDstInvert, gsMergeCopy, gsMergePaint, gsNotSrcCopy,
gsNotSrcErase, gsPatCopy, gsPatInvert, gsPatPaint, gsSrcAnd,
gsSrcCopy, gsSrcErase, gsSrcInvert, gsSrcPaint, gsWhiteness);
TMEdits = class(TCustomControl)
private
FYearEdit: TEdit;
FMonthEdit: TEdit;
FDayEdit: TEdit;
FCanMove: Boolean; //是否可以移动距离的变量
FColor: TColor;
FStyle: TGlassStyle;
FOnPaint: TNotifyEvent;
procedure SetColor(Value: TColor);
procedure SetStyle(Value: TGlassStyle);
procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED;
procedure WMEraseBkgnd(var Message: TMessage); message WM_ERASEBKGND;
procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
///数值检查函数
function CheckYear(Year: integer): Boolean;
function CheckMonth(Month: integer): Boolean;
function CheckDay(Day: integer): Boolean;
/////录入数据的类型检查
procedure CheckNum(Sender: TObject; var Key: Char); //检查键入的字符是否是数字类型
function GetCanMove: Boolean;
procedure SetCanMove(flg: Boolean);
///////使控件能移动的onmousemove过程
procedure MoveYear(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure MoveMonth(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure MoveDay(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure DayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
{ Private declarations }
protected
Buffer: TBitmap;
procedure CreateParams(var Params: TCreateParams); override;
procedure Paint; override;
procedure Resize; override;
procedure ExitCheckYear(Sender: TObject);
procedure ExitCheckMonth(Sender: TObject);
procedure ExitCheckDay(Sender: TObject);
public
{ Public declarations }
constructor Create(Aowner: TComponent); override;
destructor Destroy; override;
property Canvas;
property YearEdit: TEdit read FYearEdit;
property MonthEdit: TEdit read FMonthEdit;
property DayEdit: TEdit read FDayEdit;
published
{ Published declarations }
property CanMove: Boolean read GetCanMove write SetCanMove;
property Align;
property Anchors;
property AutoSize;
property BiDiMode;
property BorderWidth;
property Color: TColor read FColor write SetColor;
property Ctl3D;
property Enabled;
property Style: TGlassStyle read FStyle write SetStyle default gsSrcAnd;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
property OnResize;
property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
end;
procedure Register;
implementation
这是我的一个控件的声明.就没有你说得问题.你比较一下上面的use部分吧