首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

Delphi 中动态创办窗体件 Edit.text 赋值

2013-01-07 
Delphi 中动态创建窗体件 Edit.text 赋值Form1 fsMDIChild 动态创建 Create(Application)包含 一个 Edit,

Delphi 中动态创建窗体件 Edit.text 赋值
Form1 fsMDIChild 动态创建 Create(Application);

   包含 一个 Edit, 一个 Button

   点击 Button,  Form2.showmodal

Form2 fsNormal 程序开始时就创建(没有从Project --> option 的左侧列表删除)

   包含 一个 Edit, 一个 Button

   点击 button 
      Form1.edit.text = self.edit.text;
      self.close; 

出错, 类似内存地址错误。


将如 form1 程序开始时创建,则没有错误,form1.text 被赋值


[解决办法]
fsMDIChild窗体需要有另一外窗体是fsMDIForm的才能创建
[解决办法]
Form1创建没?
if Assigned(Form1) then
Form1.edit.text   =   self.edit.text

热点排行