曾
曾阿牛
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是继承TCustomcontrol父类,但是无论我在如何定义消息,
如:
procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS;
procedure wmkillfocus(var msg:twmkillfocus);message wm_killfocus;
还有CM_enter,CM_exit都不能触发该消息!这是为什么!!!
一部分代码在此!这是为什么!高手指教啊!
unit XpButton;
interface
uses
Windows, Messages, SysUtils, Classes, Controls,Graphics,ExtCtrls,Dialogs;
type
TXpButton = class(TCustomcontrol)
private
FIsDown:Boolean;
FFoucus:Boolean;
FEnter:Boolean;
FCaption:String;
// Procedure Writecaption;
procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS;
procedure wmkillfocus(var msg:twmkillfocus);message wm_killfocus;
procedure cmMouseLeave(var msg: TMessage); message cm_MouseLeave;
procedure cmMouseEnter(var msg: TMessage); message cm_MouseEnter;
Procedure BorderColor;
Procedure IsDownColor;
{ Private declarations }
protected
procedure Paint;override;
// procedure Click; override;
procedure MouseUp(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
property Caption;
Property Font;
Property TabOrder;
ProPerty TabStop;
{ Published declarations }
end;
如:
procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS;
procedure wmkillfocus(var msg:twmkillfocus);message wm_killfocus;
还有CM_enter,CM_exit都不能触发该消息!这是为什么!!!
一部分代码在此!这是为什么!高手指教啊!
unit XpButton;
interface
uses
Windows, Messages, SysUtils, Classes, Controls,Graphics,ExtCtrls,Dialogs;
type
TXpButton = class(TCustomcontrol)
private
FIsDown:Boolean;
FFoucus:Boolean;
FEnter:Boolean;
FCaption:String;
// Procedure Writecaption;
procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS;
procedure wmkillfocus(var msg:twmkillfocus);message wm_killfocus;
procedure cmMouseLeave(var msg: TMessage); message cm_MouseLeave;
procedure cmMouseEnter(var msg: TMessage); message cm_MouseEnter;
Procedure BorderColor;
Procedure IsDownColor;
{ Private declarations }
protected
procedure Paint;override;
// procedure Click; override;
procedure MouseUp(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
property Caption;
Property Font;
Property TabOrder;
ProPerty TabStop;
{ Published declarations }
end;