請問如何在 Form 中自訂義一個屬性 |
尚未結案
|
soulin12
一般會員 ![]() ![]() 發表:22 回覆:21 積分:8 註冊:2003-05-07 發送簡訊給我 |
|
Justmade
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
|
soulin12
一般會員 ![]() ![]() 發表:22 回覆:21 積分:8 註冊:2003-05-07 發送簡訊給我 |
|
Justmade
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
Following is originally posted by Jeff Overcash(TeamB)
引言: 1) Publish the property or event. 2) Add the Custom form to the Object repository. 3) Add the form to a package. 4) Add to the package the following procedure interface ... procedure Register; implementation uses dsgnIntf; ... procedure Register; begin RegisterCustomModule(TMyCustomForm, TCustomModule); end; 5) Create a new form that inherites from your custom form. You should now see the extra events and properties. |
wnhoo
高階會員 ![]() ![]() ![]() ![]() 發表:75 回覆:443 積分:198 註冊:2003-04-22 發送簡訊給我 |
//引用
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public { Public declarations }
end;
var
Form1: TForm1;
implementation
uses unit2;
{$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
begin
Unit2.myvar:=application.Title ;
Unit2.mymessage;
end; procedure TForm1.Button2Click(Sender: TObject);
begin
Unit2.myvar:='45654655';
Unit2.mymessage;
end; end. //定义
unit Unit2;
interface
uses Dialogs;
procedure mymessage;
var
myvar:string;
implementation
procedure mymessage;
begin
showmessage(myvar);
end;
end. 风花雪月 e梦情缘
------
风花雪月 e梦情缘 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |