繼承後改 events |
缺席
|
QOO10
初階會員 發表:59 回覆:89 積分:29 註冊:2002-12-25 發送簡訊給我 |
請教各位前輩,如下程式加一個屬性與改一個 event 但都無作用我那弄錯了 unit Paneltest; interface uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls,DB; type
UTSPaneltest = class(TPanel)
procedure UTSPaneltestEnter(Sender: TObject);
private
FAutolink : Boolean;
// function GetAutolink:boolean;
{ Private declarations }
procedure UTSPaneltestonEnter(Sender: TObject); protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent);override;
published
{ Published declarations }
property Autolink:Boolean read FAutoLink write FAutolink default tRUE;
end; procedure Register; implementation
uses tstdbgridu; procedure Register;
begin
RegisterComponents('Adm', [UTSPaneltest]);
end; { TPaneltest }
{
function TPaneltest.GetAutolink: boolean;
begin
result := (FAutoLink = nil);
end;} constructor UTSPaneltest.Create(AOwner: TComponent);
begin
inherited;
BorderStyle:=bsNone;
BevelInner:=bvNone;
BevelOuter:=bvNone;
end; procedure UTSPaneltest.UTSPaneltestEnter(Sender: TObject);
begin
showmessage('000')
end;
|
QOO10
初階會員 發表:59 回覆:89 積分:29 註冊:2002-12-25 發送簡訊給我 |
引言: 請教各位前輩,如下程式加一個屬性與改一個 event 但都無作用我那弄錯了 unit Paneltest; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls,DB; type UTSPaneltest = class(TPanel) procedure UTSPaneltestEnter(Sender: TObject); private FAutolink : Boolean; // function GetAutolink:boolean; { Private declarations } procedure UTSPaneltestonEnter(Sender: TObject); protected { Protected declarations } public { Public declarations } constructor Create(AOwner: TComponent);override; published { Published declarations } property Autolink:Boolean read FAutoLink write FAutolink default tRUE; end; procedure Register; implementation uses tstdbgridu; procedure Register; begin RegisterComponents('Adm', [UTSPaneltest]); end; { TPaneltest } { function TPaneltest.GetAutolink: boolean; begin result := (FAutoLink = nil); end;} constructor UTSPaneltest.Create(AOwner: TComponent); begin inherited; BorderStyle:=bsNone; BevelInner:=bvNone; BevelOuter:=bvNone; end; procedure UTSPaneltest.UTSPaneltestEnter(Sender: TObject); begin showmessage('000') end;利用 TNOTIFIEVEN 將 ONENTER 指到新的程式 |
danny
版主 發表:100 回覆:522 積分:595 註冊:2002-03-11 發送簡訊給我 |
|
QOO10
初階會員 發表:59 回覆:89 積分:29 註冊:2002-12-25 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |