请问这段代码错在哪? TForm1 = class(TForm) btn1: TButton; aaa : string; private { Private declarations } public { Public declarations } end; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1)aaa不能作为TForm1类的控件成员,只能在private/public中2)unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DateUtils, GridsEh, DBGridEh;type TForm3 = class(TForm) btn1: TButton; private aaa : string; { Private declarations } public { Public declarations } end;implementationend. 谢谢回复aaa所处的位置默认是published,为何不能加上去呢,或者改成property aaa : string;这样,但为何不行呢? PUBLICSHED 是保护类. 在TFORM类的时候,已定义好.只能加TFORM定义的类型.PUBLIC 才是你想放的地方.你改这里为属性也没有用,把这个属性加到TFORM类里面去.(不过这里也不放属性的,好像一般只见方法.) actionlist不能控制edit和combobox等控件的可见性? 在xp下运行有ado组件程序的超奇怪问题 为什么TLabel控件的文字会显示不全了,有没有解决的好办法?请各位指点 根据鼠标移动 获取控件名称 如何控制TreeView节点的长度,谢谢,100分。 请问高手,三层结构线程问题 理解Dephil中的System限定符? 怎樣才能使參數即可傳入又可傳出 求助 报表打印的问题 请教怎样从一個文本文件中把所有數字累加起來,然後顯示出結果,救救我,马上就要交了 TCoolPanel,TCoolPageControl,TCoolFormHook...是那个控件包的?
2)
unit Unit2;interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DateUtils, GridsEh, DBGridEh;type
TForm3 = class(TForm)
btn1: TButton;
private
aaa : string;
{ Private declarations }
public
{ Public declarations }
end;implementationend.
在TFORM类的时候,已定义好.只能加TFORM定义的类型.
PUBLIC 才是你想放的地方.你改这里为属性也没有用,把这个属性加到TFORM类里面去.(不过这里也不放属性的,好像一般只见方法.)