To y96:
"铁多的资料"意味作我有许多这方面得书籍,不是电子文档,没法邮给你,我这样
作是希望我们大家资源共享,何必非要200才给CoreAPI呢,就算你没分,大家还是
会回答你的问题,分高有用吗,如果你没从中学到知识,一样没用,如果大家都将
自己得口袋捂的紧紧的,那我们有何必上大富翁来讨论呢??? {B-(
控件不大,应该看得懂,不懂再留帖子???你看后可能会后悔得喔 {B-)
这个问题得200分我就不要了,叫斑竹还给你吧!!!
{
沈前卫 2000-2-11 2:29
在Dell 233MHz+Win98+Delphi4(Build5.33)下测试通过!
注意:
转贴请保持本文的完整性
}
unit MyMemo;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ScktComp,stdctrls,dsgnintf;
type
TMyListProperty=class(TClassProperty)
public
function GetAttributes:TPropertyAttributes;override;
procedure Edit;override;
end;
TMyMemo = class(TMemo)
private
{ Private declarations }
FMyList:TStringList;
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
published
{ Published declarations }
property MyList:TStringList read FMyList write FMyList;
end;
procedure Register;
implementation
function TMyListProperty.GetAttributes:TPropertyAttributes;
begin
Result:=inherited GetAttributes+[paDialog]-[paSubProperties];
end;
{自己建立一个From接受输入数据,用ShowModal显示}
procedure TMyListProperty.Edit;
var
tmpMyList:TStringList;
begin
tmpMyList:=TStringList(GetOrdValue);
tmpMyList.Clear;
tmpMyList.Add('shenqw1');
tmpMyList.Add('shenqw2');
tmpMyList.Add('shenqw3');
tmpMyList.Add('shenqw4');
tmpMyList.Add('shenqw5');
ShowMessage('自己建立一个From接受输入数据,用ShowModal显示');
Designer.Modified;
end;
constructor TMyMemo.Create(AOwner: TComponent);
begin
inherited;
FMyList:=TStringList.Create;
end;
destructor TMyMemo.Destroy;
begin
FMyList.Free;
inherited;
end;
procedure Register;
begin
RegisterComponents('Samples', [TMyMemo]);
RegisterPropertyEditor(TypeInfo(TStringList),
TMyMemo,'MyList',TMyListProperty);
end;
end.