组建的制作方法? 我在组建制作方法当中事件的创建和事件的处理(过程,函数)和方法不大清楚望大虾们提示。例如:我在(继承Tedit)组建当中有onclick事件里先写事件过程,在组建使用时点击组建是发生已经写好的事件发生。还有如果我不想有已经写好的组建事件(onclick)不知怎么做?。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在Create的时候self.OnClick=yours method; 这个怎么编译通不过呢?unit customed;interfaceuses SysUtils, Classes, Controls, StdCtrls,dialogs;type TCustomEd = class(TCustomEdit) private fed:tedit; constructor create(aowner:tcomponent); procedure ss; { Private declarations } protected { Protected declarations } public { Public declarations } published { Published declarations } end;procedure Register;implementationprocedure Register;begin RegisterComponents('Samples', [TCustomEd]);end;constructor TCustomEd.create(aowner:tcomponent); begin self.OnClick:=ss; end; procedure tcustomed.ss; begin showmessage('adf'); end;end. OnClick可以挂接的事件格式procedure ss(Sender:TObject); procedure ss(Sender: TObject); 编译通过后在组建使用时点击edit控件时怎么不发生事件呢?(showmessage事件)帮忙unit customed;interfaceuses SysUtils, Classes, Controls, StdCtrls,dialogs;type TCustomEd = class(Tedit) private fed:tedit; constructor create(aowner:tcomponent); procedure ss(sender:tobject); { Private declarations } protected { Protected declarations } public { Public declarations } published { Published declarations } end;procedure Register;implementationprocedure Register;begin RegisterComponents('Samples', [TCustomEd]);end;constructor TCustomEd.create(aowner:tcomponent); begin self.OnClick:=ss; end;procedure tcustomed.ss(sender:tobject); begin showmessage('adf'); end;end. unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;tmyEdit=class(TEdit)private procedure myOnClick(Sender:TObject);public constructor Create(AOwner: TComponent); override;end;var Form1: TForm1;implementation{$R *.dfm}{ tmyEdit }constructor tmyEdit.Create(AOwner: TComponent);begin inherited Create(AOwner); OnClick:=myOnClick;end;procedure tmyEdit.myOnClick(Sender: TObject);begin ShowMessage('Clicked Edit');end;procedure TForm1.Button1Click(Sender: TObject);varedt:tmyEdit;beginedt:=tmyEdit.Create(Self);edt.Left:=100;edt.Top:=100;edt.Parent:=Self;end;end.//重写一写构造函数;当然要记得继承 Delphi加载MySQL脚本问题 关于通过http显示图片问题,具体问题请查看内容,提供思路有分,提供具体方法者另开贴谢分,问题不难 TClientSocket 通信问题 98下 关于自动编号。。 显示ADOQuery中的数据 完全是为了抛分(要分的就来) 关于“ Response.SendRedirect('') ”的问题? 如何让DBCtrlGrid上的DBImage显示JPG格式图片? 各位老大快快帮忙! 问题啊!!!!!!!!!!! 怎么从一个文本文件中读取内容? 如何使用代码关闭系统当前打开的所有ie窗口?谢谢 请教如何取得www.google.cn里的输入框值呢?谢谢,夜等高手
self.OnClick=yours method;
SysUtils, Classes, Controls, StdCtrls,dialogs;type
TCustomEd = class(TCustomEdit) private
fed:tedit;
constructor create(aowner:tcomponent);
procedure ss;
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Samples', [TCustomEd]);
end;constructor TCustomEd.create(aowner:tcomponent);
begin
self.OnClick:=ss;
end;
procedure tcustomed.ss;
begin
showmessage('adf');
end;
end.
SysUtils, Classes, Controls, StdCtrls,dialogs;type
TCustomEd = class(Tedit)
private
fed:tedit;
constructor create(aowner:tcomponent);
procedure ss(sender:tobject);
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Samples', [TCustomEd]);
end;constructor TCustomEd.create(aowner:tcomponent);
begin
self.OnClick:=ss;
end;procedure tcustomed.ss(sender:tobject);
begin
showmessage('adf');
end;
end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
tmyEdit=class(TEdit)
private
procedure myOnClick(Sender:TObject);
public
constructor Create(AOwner: TComponent); override;
end;var
Form1: TForm1;implementation{$R *.dfm}{ tmyEdit }constructor tmyEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
OnClick:=myOnClick;
end;procedure tmyEdit.myOnClick(Sender: TObject);
begin
ShowMessage('Clicked Edit');
end;procedure TForm1.Button1Click(Sender: TObject);
var
edt:tmyEdit;
begin
edt:=tmyEdit.Create(Self);
edt.Left:=100;
edt.Top:=100;
edt.Parent:=Self;
end;end.
//重写一写构造函数;当然要记得继承