![]() |
| |
تأكد من وجود باب مفتوح تخرج منه.
|
نشرت في Delphi3000.com لا أعلم ما المشكلة مع حدث خروج المؤشر و التي تجعل من بورلاند لا تضمنه في متحكمات دلفي. فيما يلي مثال صغير يسهل تتبعه عن كيفية تنفيذ مثل هذا الحدث في متحكم TImage. أيضا فإن هذا المثال يعرض كيف يتم بناء مكوّن دلفي بسيط. إذا كنت جديدا على البرمجة بدلفي، يرجى ملاحظة النقاط التالية:
| |
unit MyImg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
ExtCtrls;
type
TMyImage = class(TImage)
private
FOnMouseLeave: TNotifyEvent;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
protected
public
published
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TMyImage]);
end;
procedure TMyImage.CMMouseLeave(var Message: TMessage);
begin
inherited;
if Assigned(FOnMouseLeave) then FOnMouseLeave(Self);
end;
end.
| ||
Shagrouni 2001 Khaled Shagrouni khaled@shagrouni.com